Skip to content
Snippets Groups Projects
Commit f948f9df authored by Yaman Umuroglu's avatar Yaman Umuroglu
Browse files

[Transform] add a give_unique_names transform

parent 6a5e4788
No related branches found
No related tags found
No related merge requests found
import copy
def give_unique_names(model):
"""Give unique names to each node in the graph using enumeration."""
new_model = copy.deepcopy(model)
node_count = 0
for n in new_model.graph.node:
n.name = "%s_%d" % (n.op_type, node_count)
node_count += 1
return new_model
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment