Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Removed the deprecated `terminate_on_nan` argument from the `Trainer` constructor ([#12553](https://github.com/PyTorchLightning/pytorch-lightning/pull/12553))


- Removed the deprecated `train_transforms` argument from the `LightningDataModule` constructor([#12662](https://github.com/PyTorchLightning/pytorch-lightning/pull/12662))


- Removed the deprecated `log_gpu_memory` argument from the `Trainer` constructor ([#12657](https://github.com/PyTorchLightning/pytorch-lightning/pull/12657))


-
- Removed the deprecated automatic logging of GPU stats by the logger connector ([#12657](https://github.com/PyTorchLightning/pytorch-lightning/pull/12657))

Expand Down
26 changes: 1 addition & 25 deletions pytorch_lightning/core/datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,8 @@ def teardown(self):

name: str = ...

def __init__(self, train_transforms=None, val_transforms=None, test_transforms=None, dims=None):
def __init__(self, val_transforms=None, test_transforms=None, dims=None):
super().__init__()
if train_transforms is not None:
rank_zero_deprecation(
"DataModule property `train_transforms` was deprecated in v1.5 and will be removed in v1.7."
)
if val_transforms is not None:
rank_zero_deprecation(
"DataModule property `val_transforms` was deprecated in v1.5 and will be removed in v1.7."
Expand All @@ -70,33 +66,13 @@ def __init__(self, train_transforms=None, val_transforms=None, test_transforms=N
)
if dims is not None:
rank_zero_deprecation("DataModule property `dims` was deprecated in v1.5 and will be removed in v1.7.")
self._train_transforms = train_transforms
self._val_transforms = val_transforms
self._test_transforms = test_transforms
self._dims = dims if dims is not None else ()

# Pointer to the trainer object
self.trainer = None

@property
def train_transforms(self):
"""Optional transforms (or collection of transforms) you can apply to train dataset.

.. deprecated:: v1.5 Will be removed in v1.7.0.
"""

rank_zero_deprecation(
"DataModule property `train_transforms` was deprecated in v1.5 and will be removed in v1.7."
)
return self._train_transforms

@train_transforms.setter
def train_transforms(self, t):
rank_zero_deprecation(
"DataModule property `train_transforms` was deprecated in v1.5 and will be removed in v1.7."
)
self._train_transforms = t

@property
def val_transforms(self):
"""Optional transforms (or collection of transforms) you can apply to validation dataset.
Expand Down
4 changes: 0 additions & 4 deletions tests/deprecated_api/test_remove_1-7.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,10 @@ def test_v1_7_0_deprecated_model_size():

def test_v1_7_0_datamodule_transform_properties(tmpdir):
dm = MNISTDataModule()
with pytest.deprecated_call(match=r"DataModule property `train_transforms` was deprecated in v1.5"):
dm.train_transforms = "a"
with pytest.deprecated_call(match=r"DataModule property `val_transforms` was deprecated in v1.5"):
dm.val_transforms = "b"
with pytest.deprecated_call(match=r"DataModule property `test_transforms` was deprecated in v1.5"):
dm.test_transforms = "c"
with pytest.deprecated_call(match=r"DataModule property `train_transforms` was deprecated in v1.5"):
_ = LightningDataModule(train_transforms="a")
with pytest.deprecated_call(match=r"DataModule property `val_transforms` was deprecated in v1.5"):
_ = LightningDataModule(val_transforms="b")
with pytest.deprecated_call(match=r"DataModule property `test_transforms` was deprecated in v1.5"):
Expand Down