Skip to content

Commit

Permalink
model_info: fix generated onnx output tensor names
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippvK committed May 13, 2024
1 parent a02aa3e commit 523f92e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mlonmcu/flow/tvm/backend/model_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,11 @@ def _helper(tensors):
out_tensors = _helper(model.graph.output)

# TVM seems to ignore the original output names for ONNX models
for i, t in enumerate(out_tensors):
t.name = f"output{i}"
if len(out_tensors) == 1:
out_tensors[0].name = "output"
else:
for i, t in enumerate(out_tensors):
t.name = f"output{i}"
super().__init__(in_tensors, out_tensors)


Expand Down

0 comments on commit 523f92e

Please sign in to comment.