提交 6b63abb5 authored 作者: Frederic's avatar Frederic

Real fix, otherwise, we where not removing useless non_seqs

上级 1a9d77ab
...@@ -123,7 +123,7 @@ def remove_constants_and_unused_inputs_scan(node): ...@@ -123,7 +123,7 @@ def remove_constants_and_unused_inputs_scan(node):
if isinstance(nw_out, tensor.Constant): if isinstance(nw_out, tensor.Constant):
givens[nw_in] = nw_out.clone() givens[nw_in] = nw_out.clone()
elif nw_in in all_ins: elif nw_in in all_ins:
identical_non_seqs = [x for x in outer_non_seqs[:idx] identical_non_seqs = [x for x in nw_outer
if scan_utils.equal_computations( if scan_utils.equal_computations(
[x], [nw_out])] [x], [nw_out])]
if identical_non_seqs: if identical_non_seqs:
...@@ -137,11 +137,6 @@ def remove_constants_and_unused_inputs_scan(node): ...@@ -137,11 +137,6 @@ def remove_constants_and_unused_inputs_scan(node):
else: else:
nw_inner += [nw_in] nw_inner += [nw_in]
nw_outer += [nw_out] nw_outer += [nw_out]
else:
# How this can happen? This case happened and if we remove
# this else, the assert in the elif will fail.
nw_inner += [nw_in]
nw_outer += [nw_out]
if len(nw_inner) != len(op_ins): if len(nw_inner) != len(op_ins):
op_outs = scan_utils.clone(op_outs, replace=givens) op_outs = scan_utils.clone(op_outs, replace=givens)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论