Skip to content

Commit 5f68bcf

Browse files
committed
refactor: add_
1 parent 856fa72 commit 5f68bcf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytorch_optimizer/ranger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def step(self, _: CLOSURE = None) -> LOSS:
162162
buffered[2] = step_size
163163

164164
if group['weight_decay'] != 0:
165-
p_data_fp32.add_(-group['weight_decay'] * group['lr'], p_data_fp32)
165+
p_data_fp32.add_(p_data_fp32, alpha=-group['weight_decay'] * group['lr'])
166166

167167
if n_sma > self.n_sma_threshold:
168168
denom = exp_avg_sq.sqrt().add_(group['eps'])

0 commit comments

Comments
 (0)