Remove the deprecated run_stage (#14870)

This commit is contained in:
Andres Algaba 2022-09-24 19:22:09 +02:00 committed by GitHub
parent 5ec12f849e
commit a6489347ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 14 deletions

View File

@ -221,6 +221,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Removed the deprecated `Trainer.use_amp` and `LightningModule.use_amp` attributes ([#14832](https://github.com/Lightning-AI/lightning/pull/14832))
- Removed the deprecated `Trainer.run_stage` in favor of `Trainer.{fit,validate,test,predict}`
- Removed the deprecated `SimpleProfiler.profile_iterable` and `AdvancedProfiler.profile_iterable` attributes ([#14864](https://github.com/Lightning-AI/lightning/pull/14864))

View File

@ -1133,13 +1133,6 @@ class Trainer(
self._logger_connector.teardown()
self._signal_connector.teardown()
def run_stage(self) -> None:
rank_zero_deprecation(
"`Trainer.run_stage` is deprecated in v1.6 and will be removed in v1.8. Use"
" `Trainer.{fit,validate,test,predict}` instead."
)
return self._run_stage()
def _run_stage(self):
self.strategy.barrier("run-stage")
self.strategy.dispatch(self)

View File

@ -65,13 +65,6 @@ def test_v1_8_0_deprecated_call_hook():
trainer.call_hook("test_hook")
def test_v1_8_0_deprecated_run_stage():
trainer = Trainer()
trainer._run_stage = Mock()
with pytest.deprecated_call(match="`Trainer.run_stage` is deprecated in v1.6 and will be removed in v1.8."):
trainer.run_stage()
def test_v1_8_0_trainer_verbose_evaluate():
trainer = Trainer()
with pytest.deprecated_call(match="verbose_evaluate` property has been deprecated and will be removed in v1.8"):