Skip to content

Commit ddf81a7

Browse files
committed
fix: d_hat
1 parent 2fe259f commit ddf81a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytorch_optimizer/optimizer/dadapt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def step(self, closure: CLOSURE = None) -> LOSS:
196196

197197
if lr > 0.0:
198198
d_hat = (sk_sq_weighted - gsq_weighted) / sk_l1
199-
d = group['d'] = max(d, min(d_hat, d * group['growth_rate']))
199+
d = group['d'] = max(d, min(d_hat.item(), d * group['growth_rate']))
200200

201201
for group in self.param_groups:
202202
group['gsq_weighted'] = gsq_weighted

0 commit comments

Comments
 (0)