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

[Core] check topological sorting before execution

parent a03ce052
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,7 @@ from finn.core.modelwrapper import ModelWrapper
from finn.core.remote_exec import remote_exec
from finn.core.rtlsim_exec import rtlsim_exec
from finn.custom_op.registry import getCustomOp
import finn.analysis.topology as ta
def execute_node(node, context, graph):
......@@ -121,6 +122,11 @@ def execute_onnx(model, input_dict, return_full_exec_context=False):
if not model.check_all_tensor_shapes_specified():
raise Exception("Found unspecified tensor shapes, try infer_shapes")
ret = model.analysis(ta.nodes_topologically_sorted)
assert (
ret["nodes_topologically_sorted"] is True
), """Nodes must be
topologically sorted."""
graph = model.graph
# first, we need to make sure that every variable required by the graph has
......
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