Skip to content

Commit

Permalink
[onnx-tools] Show total number of nodes (#14303)
Browse files Browse the repository at this point in the history
This will revise onnx-dump to show total number of nodes.

Signed-off-by: SaeHie Park <[email protected]>
  • Loading branch information
seanshpark authored Nov 5, 2024
1 parent 10d3ad3 commit 75f98dd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compiler/onnx-tools/onnx-dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,13 @@ def _dump_operators(onnx_model):
opcodes_dict[node.op_type] = 1

print("[Operators] ---------------------------")
total_nodes = 0
for opcode_key in opcodes_dict:
print("{:>5} {}".format(opcodes_dict[opcode_key], opcode_key))
total_nodes = total_nodes + opcodes_dict[opcode_key]

print("----- -----")
print("{:>5} {}".format(total_nodes, 'Total'))

print("")

Expand Down

0 comments on commit 75f98dd

Please sign in to comment.