Skip to content

Commit 377cb4a

Browse files
authored
Update lr_scheduler.py
1 parent 4e186bd commit 377cb4a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

torch/optim/lr_scheduler.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,8 @@ def print_lr(self, is_verbose, group, lr, epoch=None):
120120

121121

122122
def step(self, epoch=None):
123-
"""Raise a warning if old pattern is detected.
124-
125-
https://github.com/pytorch/pytorch/issues/20124
126-
"""
123+
# Raise a warning if old pattern is detected
124+
# https://github.com/pytorch/pytorch/issues/20124
127125
if self._step_count == 1:
128126
if not hasattr(self.optimizer.step, "_with_counter"):
129127
warnings.warn("Seems like `optimizer.step()` has been overridden after learning rate scheduler "

0 commit comments

Comments
 (0)