Skip to content

Commit

Permalink
fix 'Node' object is not iterable in functorch.compile.minifier (#103011
Browse files Browse the repository at this point in the history
)

Fixes #102169

Pull Request resolved: #103011
Approved by: https://github.com/Chillee
  • Loading branch information
makslevental authored and pytorchmergebot committed Sep 12, 2023
1 parent 063a626 commit e066056
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions torch/_functorch/fx_minifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ def remove_outputs(cur_graph, cur_inps, granularity):
output = node
break

if isinstance(output.args[0], fx.Node):
return None

output_args = sorted(output.args[0], key=lambda x: x.idx if isinstance(x, fx.Node) else int(1e9))
if len(output_args) == 1:
return None
Expand Down

0 comments on commit e066056

Please sign in to comment.