aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/rewrite_graph.py
diff options
context:
space:
mode:
Diffstat (limited to 'ethosu/vela/rewrite_graph.py')
-rw-r--r--ethosu/vela/rewrite_graph.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/ethosu/vela/rewrite_graph.py b/ethosu/vela/rewrite_graph.py
index 4f0d0107..e76e9617 100644
--- a/ethosu/vela/rewrite_graph.py
+++ b/ethosu/vela/rewrite_graph.py
@@ -69,10 +69,11 @@ def rewrite_graph_pre_order(sg, arch, tensor_rewrite_list, op_rewrite_list, rewr
tens_visit_dict[tens] = res
tens_visit_dict[res] = res
- ops = res.ops
- res.ops = []
- for op in ops:
- res.ops.append(visit_op(op))
+ if res:
+ ops = res.ops
+ res.ops = []
+ for op in ops:
+ res.ops.append(visit_op(op))
return res
sg.output_tensors = [visit_tens(tens) for tens in sg.output_tensors]
@@ -142,6 +143,8 @@ def verify_subgraph_health(sg):
op_visit_dict[op] = op
for tens in op.inputs:
+ if not tens:
+ continue
assert op in tens.consumers()
visit_tens(tens)