Skip to content

Commit

Permalink
Code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
daniil-lyakhov committed Nov 25, 2024
1 parent 66dbc45 commit b7c9e2e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nncf/experimental/torch/fx/model_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,18 @@ def remap_fn(node: torch.fx.Node):
for idx, node in enumerate(nodes_with_output):
if isinstance(node, torch.fx.Node):
continue
# Current node is the original graph output.
# Should be replaced by its arguments.
output_node = get_graph_node_by_name(model.graph, node)
args = output_node.args[0]
if isinstance(args, torch.fx.Node):
# Case of non tuple output.
args = value_remap[args]
else:
# Case of tuple output.
args = [value_remap[n] for n in args]
# Unpack target output args in case
# only one arg is presented.
# the only one arg is presented.
if len(args) == 1:
args = args[0]
nodes_with_output[idx] = args
Expand Down

0 comments on commit b7c9e2e

Please sign in to comment.