Skip to content

Commit

Permalink
[export] Minor fix to locals (pytorch#146955)
Browse files Browse the repository at this point in the history
Pull Request resolved: pytorch#146955
Approved by: https://github.com/bobrenjc93
  • Loading branch information
angelayi authored and pytorchmergebot committed Feb 13, 2025
1 parent 7b4efb4 commit 5469e5c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions torch/fx/experimental/symbolic_shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6492,11 +6492,8 @@ def go(x: Any) -> Optional[str]:
for s in x.node.expr.free_symbols:
if str(s) in frame_symbols: # type: ignore[operator]
continue
frame_symbols[str(s)] = ( # type: ignore[index]
self.var_to_sources[s][0].name() # type: ignore[assignment]
if s in self.var_to_sources
else None # unbacked
)
if s in self.var_to_sources:
frame_symbols[str(s)] = self.var_to_sources[s][0].name() # type: ignore[assignment]
return str(x)
return None

Expand Down

0 comments on commit 5469e5c

Please sign in to comment.