提交 5e3c2b9d authored 作者: Razvan Pascanu's avatar Razvan Pascanu

better assert for dictionary empty

上级 d63a2744
......@@ -777,7 +777,7 @@ def jacobian(expression, wrt, consider_constant=None, warn_type=False,
jacobs, updates = theano.scan(inner_function,
sequences=arange(expression.shape[0]),
non_sequences=[expression] + wrt)
assert len(updates.items()) == 0, \
assert not updates, \
("Scan has returned a list of updates. This should not "
"happen! Report this to theano-users (also include the "
"script that generated the error)")
......@@ -840,7 +840,7 @@ def hessian(cost, wrt, consider_constant=None, warn_type=False,
disconnected_inputs=disconnected_inputs),
sequences=arange(expr.shape[0]),
non_sequences=[expr, input])
assert len(updates.items()) == 0, \
assert not updates, \
("Scan has returned a list of updates. This should not "
"happen! Report this to theano-users (also include the "
"script that generated the error)")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论