Skip to content

Commit 82a3b06

Browse files
committed
update: codes
1 parent dea159a commit 82a3b06

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pytorch_optimizer/optimizer/experimental/ranger25.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ def step(self, closure: CLOSURE = None) -> LOSS:
169169
state = self.state[p]
170170

171171
if len(state) == 0:
172-
state['exp_avg'] = torch.zeros_like(p)
173-
state['exp_avg_sq'] = torch.zeros_like(p)
174-
state['exp_avg_slow'] = torch.zeros_like(p)
172+
state['exp_avg'] = torch.zeros_like(grad)
173+
state['exp_avg_sq'] = torch.zeros_like(grad)
174+
state['exp_avg_slow'] = torch.zeros_like(grad)
175175
state['slow_momentum'] = p.clone()
176176

177177
self.apply_weight_decay(

0 commit comments

Comments
 (0)