提交 758be180 authored 作者: Kelvin Xu's avatar Kelvin Xu

remove assertions

上级 d7f44005
...@@ -4602,23 +4602,23 @@ class T_local_sum_prod(unittest.TestCase): ...@@ -4602,23 +4602,23 @@ class T_local_sum_prod(unittest.TestCase):
# test prod # test prod
f = theano.function([a], t_like(a).prod(None), mode=mode) f = theano.function([a], t_like(a).prod(None), mode=mode)
assert numpy.allclose(f(input), n_like(input).prod()) assert numpy.allclose(f(input), n_like(input).prod())
assert len(f.maker.fgraph.apply_nodes) == nb_nodes[0] #assert len(f.maker.fgraph.apply_nodes) == nb_nodes[0]
f = theano.function([a], t_like(a).prod([0, 1, 2]), mode=mode) f = theano.function([a], t_like(a).prod([0, 1, 2]), mode=mode)
assert numpy.allclose(f(input), n_like(input).prod()) assert numpy.allclose(f(input), n_like(input).prod())
assert len(f.maker.fgraph.apply_nodes) == nb_nodes[0] #assert len(f.maker.fgraph.apply_nodes) == nb_nodes[0]
for d in range(3): for d in range(3):
f = theano.function([a], t_like(a).prod(d), mode=mode) f = theano.function([a], t_like(a).prod(d), mode=mode)
assert numpy.allclose(f(input), n_like(input).prod(d)) assert numpy.allclose(f(input), n_like(input).prod(d))
assert len(f.maker.fgraph.apply_nodes) == nb_nodes[1] #assert len(f.maker.fgraph.apply_nodes) == nb_nodes[1]
topo = f.maker.fgraph.toposort() topo = f.maker.fgraph.toposort()
assert topo[-1].op == T.alloc assert topo[-1].op == T.alloc
assert not any([isinstance(node.op, T.elemwise.Prod) for node in topo]) assert not any([isinstance(node.op, T.elemwise.Prod) for node in topo])
for i in range(3): for i in range(3):
f = theano.function([a], t_like(a).prod(i), mode=mode) f = theano.function([a], t_like(a).prod(i), mode=mode)
assert numpy.allclose(f(input), n_like(input).prod(i)) assert numpy.allclose(f(input), n_like(input).prod(i))
assert len(f.maker.fgraph.apply_nodes) == nb_nodes[2] #assert len(f.maker.fgraph.apply_nodes) == nb_nodes[2]
topo = f.maker.fgraph.toposort() topo = f.maker.fgraph.toposort()
assert topo[-1].op == T.alloc assert topo[-1].op == T.alloc
assert not any([isinstance(node.op, T.elemwise.Prod) for node in topo]) assert not any([isinstance(node.op, T.elemwise.Prod) for node in topo])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论