Skip to content

Commit

Permalink
[tools/mec] Show real operator name of custom op
Browse files Browse the repository at this point in the history
It fixes to show real operator name of custom op node.

ONE-DCO-1.0-Signed-off-by: Jonghwa Lee <[email protected]>
  • Loading branch information
batcheu committed Dec 19, 2024
1 parent 82e7d9a commit 35cb8f0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/model_explorer_circle/src/model_explorer_circle/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def load_model(self, model_path: str) -> None:
def get_opcode_name(self, opcode_index: int) -> str:
"""Convert the opcode to its name."""
opcode = self.model.operatorCodes[opcode_index].deprecatedBuiltinCode
if opcode == circle_schema.BuiltinOperator.CUSTOM:
return self.model.operatorCodes[opcode_index].customCode.decode('utf-8')
if opcode == circle_schema.BuiltinOperator.PLACEHOLDER_FOR_GREATER_OP_CODES:
opcode = self.model.operatorCodes[opcode_index].builtinCode
assert (opcode >= 127)
Expand Down

0 comments on commit 35cb8f0

Please sign in to comment.