Skip to content

Commit ed33e31

Browse files
committed
refactor: MADGRAD
1 parent 8d202da commit ed33e31

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pytorch_optimizer/optimizer/madgrad.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ def step(self, closure: CLOSURE = None) -> LOSS:
110110
if momentum > 0.0 and grad.is_sparse:
111111
raise NoSparseGradientError(self.__str__, note='momentum > 0.0')
112112

113-
grad_sum_sq = state['grad_sum_sq']
114-
s = state['s']
113+
grad_sum_sq, s = state['grad_sum_sq'], state['s']
115114

116115
if weight_decay > 0.0 and not self.decouple_decay:
117116
if grad.is_sparse:

0 commit comments

Comments
 (0)