Skip to content

Commit de21e8a

Browse files
Merge pull request #1143 from onnx/tom/FixRewriterAliasing
Fixed bug in some rewriters where ops list aliased to g._nodes
2 parents 13902dc + 3f5e61a commit de21e8a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tf2onnx/tfonnx.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
# pylint: disable=unused-variable
3535

3636
def fold_constants_using_tf(g, outputs_to_values, outputs_to_dtypes):
37-
ops = g.get_nodes()
37+
ops = list(g.get_nodes())
3838
# pylint: disable=too-many-nested-blocks
3939
keep_looking = True
4040
while keep_looking:
@@ -83,6 +83,7 @@ def rewrite_constant_fold(g, ops):
8383
"Sqrt": np.sqrt,
8484
"Sub": np.subtract,
8585
}
86+
ops = list(ops)
8687

8788
# pylint: disable=too-many-nested-blocks
8889
keep_looking = True

0 commit comments

Comments
 (0)