Skip to content

Commit

Permalink
Merge pull request #238 from michaldyczko/237-fix
Browse files Browse the repository at this point in the history
fix: change Lookahead's param_groups to a property
  • Loading branch information
kozistr authored May 29, 2024
2 parents 7205a27 + 25b4f20 commit 17893ed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pytorch_optimizer/optimizer/lookahead.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def __init__(
self.pullback_momentum = pullback_momentum

self.optimizer = optimizer
self.param_groups = self.optimizer.param_groups

self.state: STATE = defaultdict(dict)

Expand All @@ -58,6 +57,10 @@ def __init__(
**optimizer.defaults,
}

@property
def param_groups(self):
return self.optimizer.param_groups

def __getstate__(self):
return {
'state': self.state,
Expand Down

0 comments on commit 17893ed

Please sign in to comment.