Skip to content

Commit 415204e

Browse files
committed
Fix FoldConstants tranformation exiting early to redo shape annotations
This fixes some weird behavior where folding multiple nodes at once breaks the graph after the next shape inference.
1 parent cadd6b2 commit 415204e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/qonnx/transformation/fold_constants.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ def apply(self, model):
111111
# remove old node
112112
nodes_to_remove.append(n)
113113
graph_modified = True
114+
# Exit the loop here, after changing a single node. The
115+
# ModelWrapper ensures to repeat this transformatin as long as
116+
# there are suitable nodes available.
117+
# See https://github.com/fastmachinelearning/qonnx/issues/104
118+
break
114119
for node in nodes_to_remove:
115120
model.graph.node.remove(node)
116121
if graph_modified:

0 commit comments

Comments
 (0)