Skip to content

Commit

Permalink
Merge branch 'rama/pattern-builder-context' of https://github.com/mic…
Browse files Browse the repository at this point in the history
…rosoft/onnxscript into rama/pattern-builder-context
  • Loading branch information
gramalingam committed Aug 1, 2024
2 parents 0599d7f + ed166b2 commit 212d723
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions onnxscript/ir/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1647,12 +1647,12 @@ def _check_node_safe_to_remove(
raise ValueError(
f"Node '{node!r}' is still an output of the graph and cannot be removed when safe=True."
)
for use, _ in output.uses():
if use in to_remove:
continue
uses_not_to_remove = [user for user, _ in output.uses() if user not in to_remove]
if uses_not_to_remove:
raise ValueError(
f"Node '{use!r}' is still being used by other nodes that are not to be "
f"removed. All of its uses: {list(output.uses())!r}"
f"Output value '{output!r}' is still being used by other nodes that are not to be "
f"removed. All of its users that is not being removed: {uses_not_to_remove!r}. "
"Please make sure these nodes are no longer using the output value."
)


Expand Down

0 comments on commit 212d723

Please sign in to comment.