Skip to content

Commit fc8882c

Browse files
ailzhangweiyangfb
authored andcommitted
_LRSchedulers getstate include optimizer info (pytorch#7757)
* getstate should include optimizer * remove getstate/setstate functions
1 parent a9c0fc7 commit fc8882c

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

torch/optim/lr_scheduler.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ def __init__(self, optimizer, last_epoch=-1):
2222
self.step(last_epoch + 1)
2323
self.last_epoch = last_epoch
2424

25-
def __getstate__(self):
26-
return self.state_dict()
27-
28-
def __setstate__(self, state):
29-
self.load_state_dict(state)
30-
3125
def state_dict(self):
3226
"""Returns the state of the scheduler as a :class:`dict`.
3327

0 commit comments

Comments
 (0)