From cdcd0a92ca8a3dc120336a5dde1b7d6ecd5e9186 Mon Sep 17 00:00:00 2001 From: Mi-Peng Date: Wed, 19 Jan 2022 17:49:43 +0800 Subject: [PATCH] fix lars --- timm/optim/lars.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timm/optim/lars.py b/timm/optim/lars.py index 98198e67..38ca9e0b 100644 --- a/timm/optim/lars.py +++ b/timm/optim/lars.py @@ -114,7 +114,7 @@ class Lars(Optimizer): ) if group['trust_clip']: trust_ratio = torch.minimum(trust_ratio / group['lr'], one_tensor) - grad.add(p, alpha=weight_decay) + grad.add_(p, alpha=weight_decay) grad.mul_(trust_ratio) # apply SGD update https://github.com/pytorch/pytorch/blob/1.7/torch/optim/sgd.py#L100