提交 7a79acaf authored 作者: Frederic's avatar Frederic

Fix test in float32

上级 22fb1439
...@@ -3259,14 +3259,14 @@ class Test_local_useless_elemwise_comparison(unittest.TestCase): ...@@ -3259,14 +3259,14 @@ class Test_local_useless_elemwise_comparison(unittest.TestCase):
topo = f.maker.fgraph.toposort() topo = f.maker.fgraph.toposort()
assert len(topo) == 1 assert len(topo) == 1
assert isinstance(topo[0].op, Shape_i), topo[0].op assert isinstance(topo[0].op, Shape_i), topo[0].op
x_val = numpy.ones(100) x_val = numpy.ones(100, dtype=config.floatX)
assert f(x_val) == x_val.shape[0] assert f(x_val) == x_val.shape[0]
f = theano.function([x], T.maximum(0, x.shape[0]), mode=mode) f = theano.function([x], T.maximum(0, x.shape[0]), mode=mode)
topo = f.maker.fgraph.toposort() topo = f.maker.fgraph.toposort()
assert len(topo) == 1 assert len(topo) == 1
assert isinstance(topo[0].op, Shape_i), topo[0].op assert isinstance(topo[0].op, Shape_i), topo[0].op
x_val = numpy.ones(100) x_val = numpy.ones(100, dtype=config.floatX)
assert f(x_val) == x_val.shape[0] assert f(x_val) == x_val.shape[0]
f = theano.function([x], T.minimum(x.shape[0], 0), mode=mode) f = theano.function([x], T.minimum(x.shape[0], 0), mode=mode)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论