提交 7748dfee authored 作者: Sina Honari's avatar Sina Honari

making reshape_nodes compatible with python 3

上级 726d93d1
...@@ -5895,8 +5895,7 @@ def test_local_flatten_lift(): ...@@ -5895,8 +5895,7 @@ def test_local_flatten_lift():
shape_out_np = tuple(x_np.shape[:i-1])+(numpy.prod(x_np.shape[i-1:]),) shape_out_np = tuple(x_np.shape[:i-1])+(numpy.prod(x_np.shape[i-1:]),)
assert shape_out_np == out_np.shape assert shape_out_np == out_np.shape
reshape_nodes = filter( reshape_nodes = [n for n in topo if isinstance(n.op, tensor.Reshape)]
lambda apply_node: isinstance(apply_node.op, tensor.Reshape), topo)
assert (len(reshape_nodes) == 1 and assert (len(reshape_nodes) == 1 and
tensor.is_flat(reshape_nodes[0].outputs[0], outdim=i)) tensor.is_flat(reshape_nodes[0].outputs[0], outdim=i))
assert isinstance(topo[-1].op, tensor.Elemwise) assert isinstance(topo[-1].op, tensor.Elemwise)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论