提交 ab6fa7b8 authored 作者: Frederic Bastien's avatar Frederic Bastien

work around a numpy bug. This fix a test. close ticket #552

上级 775a4040
......@@ -508,6 +508,11 @@ class TensorType(Type):
if 'int' in str(a.dtype):
return numpy.all(a==b)
else:
#work around a numpy.allclose bug: http://projects.scipy.org/numpy/ticket/1672
if a.ndim==0 and numpy.isinf(a):
a = a.reshape(1)
b = b.reshape(1)
cmp = _allclose(a, b)
if cmp:
# Numpy claims they are close, this is good enough for us.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论