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

fix test crash as we lowered the default threashold.

We raise it a little for this test, but it is still lower then what it was before.
上级 7ddbdd1e
...@@ -97,7 +97,15 @@ def test_sum(): ...@@ -97,7 +97,15 @@ def test_sum():
if val.size==0: if val.size==0:
assert f2(val)==f(val), ('shape', shape, 'pattern', pattern) assert f2(val)==f(val), ('shape', shape, 'pattern', pattern)
else: else:
try:
#We raise the error threashold as we sum big matrix
#and this cause small rounding difference with some seed
#example in debug mode with unittests.rseed=9275
orig_rtol = theano.tensor.basic.float32_rtol
theano.tensor.basic.float32_rtol = 2e-5
assert _allclose(f2(val),f(val)), ('shape', shape, 'pattern', pattern, sum([shape[i] for i in pattern])) assert _allclose(f2(val),f(val)), ('shape', shape, 'pattern', pattern, sum([shape[i] for i in pattern]))
finally:
theano.tensor.basic.float32_rtol = orig_rtol
#test with dimshuffle #test with dimshuffle
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论