提交 c9d31714 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

Fix infer shape when scan behaves like a repeat-until

上级 4c29e690
......@@ -979,6 +979,11 @@ class Scan(PureOp):
scan_outs += [x for x in
input_shapes[offset:offset + self.n_shared_outs]]
# if we are dealing with a repeat-until, then we do not know the
# leading dimension so we replace it for every entry with Shape_i
if self.as_while:
scan_outs = [(Shape_i(0)(o),)+x[1:]
for o, x in zip(node.outputs,scan_outs)]
return scan_outs
### GRAD FUNCTION
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论