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

[Transform] add function to get new valueinfo name

parent b9a2e8d1
No related branches found
No related tags found
No related merge requests found
...@@ -65,3 +65,15 @@ def find_consumer(model, tensor_name): ...@@ -65,3 +65,15 @@ def find_consumer(model, tensor_name):
return model.graph.node[consumer_ind] return model.graph.node[consumer_ind]
except ValueError: except ValueError:
return None return None
def make_new_valueinfo_name(model):
"""Returns a name that can be used for a new value_info."""
graph = model.graph
names = [x.name for x in graph.value_info]
names += [x.name for x in graph.input]
names += [x.name for x in graph.output]
candidate = str(len(names) + 1)
while candidate in names:
candidate = str(int(candidate) + 1)
return candidate
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