提交 a6e40db0 authored 作者: David Warde-Farley's avatar David Warde-Farley

Simplified reassembly of shape tuples in infer_shape.

上级 4cdb561f
......@@ -145,14 +145,13 @@ class IfElse(PureOp):
# generate pairs of shapes
out_shapes = []
idx = 0
for out in node.outputs:
current_shape = []
for k in xrange(out.ndim):
current_shape += [new_outs[idx]]
idx += 1
out_shapes += [tuple(current_shape)]
out_shapes.append(tuple(new_outs[:out.ndim]))
new_outs = new_outs[out.ndim:]
# new_outs should be an empty list after last iteration
assert len(new_outs) == 0
return out_shapes
def make_node(self, c, *args):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论