Skip to content

Commit 28f7b93

Browse files
BordaSkafteNicki
andauthored
Apply suggestions from code review
Co-authored-by: Nicki Skafte Detlefsen <[email protected]>
1 parent 18bd563 commit 28f7b93

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

tests/tests_pytorch/tuner/test_lr_finder.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -622,9 +622,6 @@ def test_gradient_correctness():
622622
def test_lr_finder_callback_applies_lr_after_restore(tmp_path):
623623
"""LearningRateFinder used as a callback should apply its suggested LR to the optimizer used after state
624624
restoration.
625-
626-
This currently fails: the LR is set during the search but lost after restore.
627-
628625
"""
629626

630627
import torch.nn as nn
@@ -681,7 +678,7 @@ def configure_optimizers(self):
681678
)
682679

683680
trainer.fit(model, train_loader)
684-
681+
assert model.hparams.lr is not None
685682
# Ensure LR Finder produced a suggestion for this setup; if not, the test can't assert application
686683
assert lr_finder_cb.optimal_lr is not None, "LR Finder should have computed results"
687684
suggestion = lr_finder_cb.optimal_lr.suggestion()

0 commit comments

Comments
 (0)