Skip to content

Commit

Permalink
[tools/mec] Add attributes of operator node (#14356)
Browse files Browse the repository at this point in the history
It adds the attributes of each operator such as 'StrideW', 'StrideH',
and 'FusedActivationFunction' according to the operator type.

ONE-DCO-1.0-Signed-off-by: Jonghwa Lee <[email protected]>
  • Loading branch information
batcheu authored Nov 25, 2024
1 parent 48cb060 commit 6c52205
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/model_explorer_circle/src/circle_adapter/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ def build_graph(self, me_graph: graph_builder.Graph) -> None:
me_graph.nodes.append(me_node)
# Add output metadata to the operator node
self.add_output_tensor_info(me_node=me_node, tensor_id=output_tensor_id)
# Add operator attributes
if '__dict__' in dir(op.builtinOptions):
for k, v in op.builtinOptions.__dict__.items():
me_node.attrs.append(graph_builder.KeyValue(key=k, value=f'{v}'))
# Connect edges from inputs to this operator node
for i, tensor_id in enumerate(op.inputs):
if tensor_id < 0:
Expand Down

0 comments on commit 6c52205

Please sign in to comment.