Skip to content

Commit

Permalink
Fix bug with source map
Browse files Browse the repository at this point in the history
  • Loading branch information
mlazos committed Jun 3, 2023
1 parent 9c3b0d4 commit 7fbd56d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions torch/_dynamo/variables/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ def map_grads_to_sources(self):
group_source = GetItemSource(AttrSource(self.source, "param_groups"), g_ind)
for p_ind, p in enumerate(group["params"]):
if p.grad is not None:
self.grad_to_source[p.grad] = GetItemSource(
GetItemSource(group_source, "params"), p_ind
self.grad_to_source[p.grad] = AttrSource(
GetItemSource(GetItemSource(group_source, "params"), p_ind),
"grad",
)

def var_getattr(self, tx, name):
Expand Down

0 comments on commit 7fbd56d

Please sign in to comment.