Skip to content

Commit fa0ed17

Browse files
authored
remove deprecated train_loop (#10482)
* remove deprecated train_loop * chlog
1 parent 09cf167 commit fa0ed17

File tree

4 files changed

+5
-17
lines changed

4 files changed

+5
-17
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
113113
- Removed deprecated `utilities.distributed.rank_zero_{warn/deprecation}` ([#10451](https://github.com/PyTorchLightning/pytorch-lightning/pull/10451))
114114

115115

116+
- Removed deprecated `Trainer.train_loop` property in favor of `Trainer.fit_loop` ([#10482](https://github.com/PyTorchLightning/pytorch-lightning/pull/10482))
117+
118+
116119
### Fixed
117120

118121
- Fixed an issue where class or init-only variables of dataclasses were passed to the dataclass constructor in `utilities.apply_to_collection` ([#9702](https://github.com/PyTorchLightning/pytorch-lightning/issues/9702))

docs/source/common/lightning_module.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,14 +1167,14 @@ for more information.
11671167
11681168
on_train_start()
11691169
for epoch in epochs:
1170-
train_loop()
1170+
fit_loop()
11711171
on_train_end()
11721172
11731173
on_fit_end()
11741174
teardown("fit")
11751175
11761176
1177-
def train_loop():
1177+
def fit_loop():
11781178
on_epoch_start()
11791179
on_train_epoch_start()
11801180

pytorch_lightning/trainer/trainer.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,13 +2134,6 @@ def __getstate__(self):
21342134
def __setstate__(self, state):
21352135
self.__dict__ = state
21362136

2137-
@property
2138-
def train_loop(self) -> FitLoop:
2139-
rank_zero_deprecation(
2140-
"`Trainer.train_loop` has been renamed to `Trainer.fit_loop` and will be removed in v1.6."
2141-
)
2142-
return self.fit_loop
2143-
21442137
@property
21452138
def terminate_on_nan(self) -> bool:
21462139
rank_zero_deprecation("`Trainer.terminate_on_nan` is deprecated in v1.5 and will be removed in 1.7.")

tests/deprecated_api/test_remove_1-6.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,6 @@ def test_v1_6_0_is_overridden_model():
6969
assert not is_overridden("foo", model=model)
7070

7171

72-
def test_v1_6_0_train_loop(tmpdir):
73-
trainer = Trainer()
74-
with pytest.deprecated_call(
75-
match=r"`Trainer.train_loop` has been renamed to `Trainer.fit_loop` and will be removed in v1.6."
76-
):
77-
_ = trainer.train_loop
78-
79-
8072
def test_v1_6_0_deprecated_model_summary_mode(tmpdir):
8173
model = BoringModel()
8274
with pytest.deprecated_call(match="Argument `mode` in `ModelSummary` is deprecated in v1.4"):

0 commit comments

Comments
 (0)