提交 4d85200e authored 作者: gdesjardins's avatar gdesjardins

BUG FIX: when using scan with k=1, tensor outputs (of the Scan op) should not be

left-padded if the user asked NOT to store intermediate results (this should be the default-case for shared variables)
上级 8d2f4abe
...@@ -862,7 +862,7 @@ def scan(fn, sequences=[], outputs_info=[], non_sequences=[], ...@@ -862,7 +862,7 @@ def scan(fn, sequences=[], outputs_info=[], non_sequences=[],
else: else:
# If we do not actually need scan # If we do not actually need scan
for pos, inner_out in enumerate(inner_fn_outs): for pos, inner_out in enumerate(inner_fn_outs):
if isinstance(inner_out.type, tensor.TensorType): if isinstance(inner_out.type, tensor.TensorType) and store_steps[pos] != 1:
inner_fn_outs[pos] = tensor.unbroadcast( tensor.shape_padleft(inner_out),0) inner_fn_outs[pos] = tensor.unbroadcast( tensor.shape_padleft(inner_out),0)
values = inner_fn_outs values = inner_fn_outs
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论