提交 378f82be authored 作者: Frederic's avatar Frederic

Fix another case of equal_computations() with NoneConst and add a test.

上级 bb572061
...@@ -424,9 +424,7 @@ def equal_computations(xs, ys, in_xs=None, in_ys=None): ...@@ -424,9 +424,7 @@ def equal_computations(xs, ys, in_xs=None, in_ys=None):
return False return False
elif (isinstance(dx, tensor.Constant) and elif (isinstance(dx, tensor.Constant) and
isinstance(dy, tensor.Constant)): isinstance(dy, tensor.Constant)):
if not (numpy.all(dx.data == dy.data) and if not dx.equals(dy):
dx.type.dtype == dy.type.dtype and
dx.data.shape == dy.data.shape):
return False return False
else: else:
pass pass
......
import theano
from theano.scan_module.scan_utils import equal_computations
from theano.tensor.type_other import NoneConst
def test_equal_compuations():
# This was a bug report by a Theano user.
c = NoneConst
assert equal_computations([c], [c])
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论