提交 148a5819 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Raise absolute tolerance instead of relative one.

上级 92e0000d
...@@ -895,13 +895,16 @@ class UsmmTests(unittest.TestCase): ...@@ -895,13 +895,16 @@ class UsmmTests(unittest.TestCase):
z - a * theano.sparse.dot(x, y), z - a * theano.sparse.dot(x, y),
mode=mode) mode=mode)
# In DebugMode there is a strange difference with complex # In DebugMode there is a strange difference with complex
# So we raise a little the threashold a little. # So we raise a little the threshold a little.
try: try:
orig = theano.tensor.basic.float64_rtol orig_atol = theano.tensor.basic.float64_atol
theano.tensor.basic.float64_rtol = 1e-5 orig_rtol = theano.tensor.basic.float64_rtol
theano.tensor.basic.float64_atol = 1e-7
theano.tensor.basic.float64_rtol = 1e-6
f_a_out = f_a(a_data, x_data, y_data) f_a_out = f_a(a_data, x_data, y_data)
finally: finally:
theano.tensor.basic.float64_rtol = orig theano.tensor.basic.float64_atol = orig_atol
theano.tensor.basic.float64_rtol = orig_rtol
assert _allclose(f_a_out, f_b_out, rtol=1e-5) assert _allclose(f_a_out, f_b_out, rtol=1e-5)
topo = f_a.maker.env.toposort() topo = f_a.maker.env.toposort()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论