def test_merge(self):
raise SkipTest("Optimization temporarily disabled")
x = tensor.vector('x')
y = tensor.vector('y')
c = tensor.iscalar('c')
z1 = ifelse(c, x + 1, y + 1)
z2 = ifelse(c, x + 2, y + 2)
z = z1 + z2
f = theano.function([c, x, y], z)
assert len([n for n in f.maker.fgraph.toposort()
if isinstance(n.op, IfElse)]) == 1
评论列表
文章目录