Skip to content

Commit 7f73252

Browse files
authored
Merge pull request #1094 from Mi-Peng/lars
fix lars
2 parents 2d4b7e7 + cdcd0a9 commit 7f73252

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

timm/optim/lars.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def step(self, closure=None):
114114
)
115115
if group['trust_clip']:
116116
trust_ratio = torch.minimum(trust_ratio / group['lr'], one_tensor)
117-
grad.add(p, alpha=weight_decay)
117+
grad.add_(p, alpha=weight_decay)
118118
grad.mul_(trust_ratio)
119119

120120
# apply SGD update https://github.com/pytorch/pytorch/blob/1.7/torch/optim/sgd.py#L100

0 commit comments

Comments
 (0)