-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into metrics/fix_states
- Loading branch information
Showing
4 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import pytest | ||
from pytorch_lightning import Trainer | ||
from tests.base import EvalModelTemplate | ||
|
||
|
||
@pytest.mark.parametrize('tuner_alg', ['batch size scaler', 'learning rate finder']) | ||
def test_skip_on_fast_dev_run_batch_scaler(tmpdir, tuner_alg): | ||
""" Test that tuner algorithms are skipped if fast dev run is enabled """ | ||
|
||
hparams = EvalModelTemplate.get_default_hparams() | ||
model = EvalModelTemplate(**hparams) | ||
trainer = Trainer( | ||
default_root_dir=tmpdir, | ||
max_epochs=2, | ||
auto_scale_batch_size=True if tuner_alg == 'batch size scaler' else False, | ||
auto_lr_find=True if tuner_alg == 'learning rate finder' else False, | ||
fast_dev_run=True | ||
) | ||
expected_message = f'Skipping {tuner_alg} since `fast_dev_run=True`' | ||
with pytest.warns(UserWarning, match=expected_message): | ||
trainer.tune(model) |