Skip to content

Commit 6f7451e

Browse files
committed
update: grad
1 parent 2d0fbd5 commit 6f7451e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytorch_optimizer/optimizer/adashift.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def step(self, closure: CLOSURE = None) -> LOSS:
8686
state = self.state[p]
8787

8888
if len(state) == 0:
89-
state['grad_queue'] = deque([p.grad.clone()], maxlen=group['keep_num'])
89+
state['grad_queue'] = deque([grad.clone()], maxlen=group['keep_num'])
9090
state['exp_avg'] = torch.zeros_like(p)
9191
state['exp_avg_sq'] = torch.zeros_like(p)
9292

0 commit comments

Comments
 (0)