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

print more info in one error.

上级 2964c26d
...@@ -123,8 +123,8 @@ def makeTester(name, op, expected, checks = {}, good = {}, bad_build = {}, bad_r ...@@ -123,8 +123,8 @@ def makeTester(name, op, expected, checks = {}, good = {}, bad_build = {}, bad_r
for i, (variable, expected) in enumerate(zip(variables, expecteds)): for i, (variable, expected) in enumerate(zip(variables, expecteds)):
if variable.dtype != expected.dtype or variable.shape != expected.shape or \ if variable.dtype != expected.dtype or variable.shape != expected.shape or \
numpy.any(numpy.abs(variable - expected) > eps): numpy.any(numpy.abs(variable - expected) > eps):
self.fail("Test %s::%s: Output %s gave the wrong value. With inputs %s, expected %s, got %s." self.fail("Test %s::%s: Output %s gave the wrong value. With inputs %s, expected %s, got %s. numpy.allclose return %s %s"
% (self.op, testname, i, inputs, expected, variable)) % (self.op, testname, i, inputs, expected, variable, numpy.allclose(variable,expected,atol=eps), numpy.allclose(variable,expected)))
for description, check in self.checks.items(): for description, check in self.checks.items():
if not check(inputs, variables): if not check(inputs, variables):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论