Skip to content

Commit 0f99fcf

Browse files
carmoccalexierule
authored andcommitted
[CLI] Save only the configuration used (#11532)
1 parent 8ce0621 commit 0f99fcf

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
88

99
### Fixed
1010

11-
-
11+
- Fixed the format of the configuration saved automatically by the CLI's `SaveConfigCallback` ([#11532](https://github.com/PyTorchLightning/pytorch-lightning/pull/11532))
12+
1213

1314
-
1415

tests/utilities/test_cli.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,10 @@ def test_lightning_cli_config_before_subcommand():
12591259
validate_mock.assert_called_once_with(cli.trainer, cli.model, verbose=False, ckpt_path="barfoo")
12601260
assert cli.trainer.limit_val_batches == 1
12611261

1262+
save_config_callback = cli.trainer.callbacks[0]
1263+
assert save_config_callback.config["trainer"]["limit_val_batches"] == 1
1264+
assert save_config_callback.parser.subcommand == "validate"
1265+
12621266

12631267
@RunIf(min_python="3.7.3")
12641268
def test_lightning_cli_config_before_subcommand_two_configs():

0 commit comments

Comments
 (0)