提交 8f64c64f authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #3539 from jotterbach/patch-1

changing `assert` to `AssertionError`
...@@ -431,7 +431,8 @@ def grad(cost, wrt, consider_constant=None, ...@@ -431,7 +431,8 @@ def grad(cost, wrt, consider_constant=None,
from theano import tensor from theano import tensor
if cost is None: if cost is None:
assert known_grads is not None if known_grads is None:
raise AssertionError("cost and known_grads can't both be None.")
if cost is not None and isinstance(cost.type, NullType): if cost is not None and isinstance(cost.type, NullType):
raise ValueError("Can't differentiate a NaN cost." raise ValueError("Can't differentiate a NaN cost."
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论