提交 0952b0d1 authored 作者: medakk's avatar medakk

Change numpy.any to numpy.all in check_equal_numpy

上级 37d5f777
...@@ -72,7 +72,7 @@ def check_equal_numpy(x, y): ...@@ -72,7 +72,7 @@ def check_equal_numpy(x, y):
""" """
if isinstance(x, numpy.ndarray) and isinstance(y, numpy.ndarray): if isinstance(x, numpy.ndarray) and isinstance(y, numpy.ndarray):
return (x.dtype == y.dtype and x.shape == y.shape and return (x.dtype == y.dtype and x.shape == y.shape and
numpy.any(abs(x - y) < 1e-10)) numpy.all(abs(x - y) < 1e-10))
elif (isinstance(x, numpy.random.RandomState) and elif (isinstance(x, numpy.random.RandomState) and
isinstance(y, numpy.random.RandomState)): isinstance(y, numpy.random.RandomState)):
return python_all(numpy.all(a == b) for a, b in return python_all(numpy.all(a == b) for a, b in
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论