Skip to content

Commit

Permalink
onnx-graphsurgeon - remove unused input in modified graph in example …
Browse files Browse the repository at this point in the history
…04 (NVIDIA#2540)

* remove unused input from the modified graph in example 04 in onnx-graphsurgeon

Signed-off-by: Kelvinthedrugger <[email protected]>
  • Loading branch information
Kelvinthedrugger authored Dec 20, 2022
1 parent 8423367 commit c6eea95
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
# Therefore, you should only need to sort the graph when you have added new nodes out-of-order.
# In this case, the identity node is already in the correct spot (it is the last node,
# and was appended to the end of the list), but to be on the safer side, we can sort anyway.
graph.cleanup().toposort()

graph.cleanup(remove_unused_graph_inputs=True).toposort()

onnx.save(gs.export_onnx(graph), "modified.onnx")

0 comments on commit c6eea95

Please sign in to comment.