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

[Transform] handle 1-node graphs correctly in SortGraph

parent 7409bc8b
No related branches found
No related tags found
No related merge requests found
......@@ -189,6 +189,9 @@ class SortGraph(Transformation):
# Probably this is faster than copying initializers and more robust in general
def apply(self, model):
if len(model.graph.node) == 1:
# single-node graph, nothing to sort
return (model, False)
# Gather graph structure
graph_dependencies = {}
node_list = [
......@@ -214,7 +217,7 @@ class SortGraph(Transformation):
for new_idx, sorted_idx in enumerate(sorted_node_indexes):
model.graph.node.insert(new_idx, node_list[sorted_idx])
return model, False
return (model, False)
class ConvertSubToAdd(Transformation):
......
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