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