提交 c2aca18f authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Fixed test added in e3135d2a3e90 that failed in DebugMode

上级 56368895
...@@ -1182,7 +1182,14 @@ def test_nan_inf_constant_signature(): ...@@ -1182,7 +1182,14 @@ def test_nan_inf_constant_signature():
# Also test that nan !=0 and nan != nan. # Also test that nan !=0 and nan != nan.
x = tensor.scalar() x = tensor.scalar()
f = theano.function([x], eq(x, numpy.nan)) mode = get_default_mode()
if isinstance(mode, theano.compile.debugmode.DebugMode):
# Disable the check preventing usage of NaN / Inf values.
# We first do a copy of the mode to avoid side effects on other tests.
mode = copy(mode)
mode.check_isfinite = False
f = theano.function([x], eq(x, numpy.nan), mode=mode)
assert f(0) == 0 assert f(0) == 0
assert f(numpy.nan) == 0 assert f(numpy.nan) == 0
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论