Skip to content

Commit

Permalink
[tools/mec] Append variadic inputs names with index (#14482)
Browse files Browse the repository at this point in the history
It adds the indexed name to variadic inputs.
(e.g. 2 inputs for CONCATENATION : 'values[0]', values[1]')

ONE-DCO-1.0-Signed-off-by: Jonghwa Lee <[email protected]>
  • Loading branch information
batcheu authored Dec 19, 2024
1 parent 1f7bf52 commit d657636
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tools/model_explorer_circle/src/model_explorer_circle/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,17 @@ def add_incoming_edge(self, me_node: graph_builder.GraphNode, tensor_id: int,
targetNodeInputId=f'{input_id}'))
# Add input metadata of the node if it exists
if self.input_args.get(me_node.label) is not None:
arg_name = self.input_args[me_node.label][input_id]
arity = len(self.input_args[me_node.label])
if input_id < arity:
arg_name = self.input_args[me_node.label][input_id]
else:
# For variadic inputs, append index to the last argument name
arg_name = self.input_args[me_node.label][arity - 1]
# Update 1st argument name of variadic inputs when 2nd argument name is added
if input_id == arity:
me_node.inputsMetadata[-1].attrs[0].value = arg_name + '[0]'
arg_name += f'[{input_id - arity + 1}]'

me_node.inputsMetadata.append(
graph_builder.MetadataItem(
id=f'{input_id}',
Expand Down

0 comments on commit d657636

Please sign in to comment.