Skip to content

Commit a648934

Browse files
authored
Remove the deprecated run_stage (#14870)
1 parent 5ec12f8 commit a648934

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

src/pytorch_lightning/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
221221

222222
- Removed the deprecated `Trainer.use_amp` and `LightningModule.use_amp` attributes ([#14832](https://github.com/Lightning-AI/lightning/pull/14832))
223223

224+
- Removed the deprecated `Trainer.run_stage` in favor of `Trainer.{fit,validate,test,predict}`
225+
224226

225227
- Removed the deprecated `SimpleProfiler.profile_iterable` and `AdvancedProfiler.profile_iterable` attributes ([#14864](https://github.com/Lightning-AI/lightning/pull/14864))
226228

src/pytorch_lightning/trainer/trainer.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,13 +1133,6 @@ def _teardown(self):
11331133
self._logger_connector.teardown()
11341134
self._signal_connector.teardown()
11351135

1136-
def run_stage(self) -> None:
1137-
rank_zero_deprecation(
1138-
"`Trainer.run_stage` is deprecated in v1.6 and will be removed in v1.8. Use"
1139-
" `Trainer.{fit,validate,test,predict}` instead."
1140-
)
1141-
return self._run_stage()
1142-
11431136
def _run_stage(self):
11441137
self.strategy.barrier("run-stage")
11451138
self.strategy.dispatch(self)

tests/tests_pytorch/deprecated_api/test_remove_1-8.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,6 @@ def test_v1_8_0_deprecated_call_hook():
6565
trainer.call_hook("test_hook")
6666

6767

68-
def test_v1_8_0_deprecated_run_stage():
69-
trainer = Trainer()
70-
trainer._run_stage = Mock()
71-
with pytest.deprecated_call(match="`Trainer.run_stage` is deprecated in v1.6 and will be removed in v1.8."):
72-
trainer.run_stage()
73-
74-
7568
def test_v1_8_0_trainer_verbose_evaluate():
7669
trainer = Trainer()
7770
with pytest.deprecated_call(match="verbose_evaluate` property has been deprecated and will be removed in v1.8"):

0 commit comments

Comments
 (0)