提交 6baf58f1 authored 作者: Frederic's avatar Frederic

Fix a test when it run on the GPU.

上级 56135c87
...@@ -67,7 +67,10 @@ class test_ifelse(unittest.TestCase, utt.TestOptimizationMixin): ...@@ -67,7 +67,10 @@ class test_ifelse(unittest.TestCase, utt.TestOptimizationMixin):
y2 = reduce(lambda x, y: x + y, [y] + list(range(200))) y2 = reduce(lambda x, y: x + y, [y] + list(range(200)))
f = theano.function([c, x, y], ifelse(c, x, y2), mode=mode) f = theano.function([c, x, y], ifelse(c, x, y2), mode=mode)
# For not inplace ifelse # For not inplace ifelse
self.assertFunctionContains1(f, IfElse(1)) ifnode = [n for n in f.maker.fgraph.toposort()
if isinstance(n.op, IfElse)]
assert len(ifnode) == 1
assert not ifnode[0].op.as_view
rng = numpy.random.RandomState(utt.fetch_seed()) rng = numpy.random.RandomState(utt.fetch_seed())
xlen = rng.randint(200) xlen = rng.randint(200)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论