提交 f85b01e1 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

In tensor._allclose, work around a bug in numpy.allclose.

上级 8b7d0d74
......@@ -321,6 +321,11 @@ def _allclose(a, b):
else:
atol = float64_atol
rtol = float64_rtol
# Work around bug in Numpy, see http://projects.scipy.org/numpy/ticket/1684
if str(b.dtype).startswith('int') and (numpy.absolute(b) < 0).any():
b = theano._asarray(b, dtype='float64')
return numpy.allclose(a,b, atol=atol, rtol=rtol)
def get_constant_value(v):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论