diff --git a/docs/source-pytorch/api_references.rst b/docs/source-pytorch/api_references.rst index c722af960212b..33e5d92bea984 100644 --- a/docs/source-pytorch/api_references.rst +++ b/docs/source-pytorch/api_references.rst @@ -314,6 +314,7 @@ utilities :nosignatures: argparse + data deepspeed distributed finite_checks diff --git a/src/pytorch_lightning/CHANGELOG.md b/src/pytorch_lightning/CHANGELOG.md index 5455ce9099869..74e10f1de880e 100644 --- a/src/pytorch_lightning/CHANGELOG.md +++ b/src/pytorch_lightning/CHANGELOG.md @@ -77,6 +77,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Removed the deprecated code in `pl.utilities.xla_device` ([#16404](https://github.com/Lightning-AI/lightning/pull/16404)) +- Removed the deprecated code in `pl.utilities.data` ([#16440](https://github.com/Lightning-AI/lightning/pull/16440)) + - Removed the deprecated code in `pl.utilities.device_parser` ([#16412](https://github.com/Lightning-AI/lightning/pull/16412)) - Removed the deprecated code in `pl.utilities.optimizer` ([#16439](https://github.com/Lightning-AI/lightning/pull/16439)) diff --git a/src/pytorch_lightning/utilities/data.py b/src/pytorch_lightning/utilities/data.py index 60d93e8e73629..3ee332c4370aa 100644 --- a/src/pytorch_lightning/utilities/data.py +++ b/src/pytorch_lightning/utilities/data.py @@ -38,7 +38,7 @@ from pytorch_lightning.utilities.auto_restart import CaptureIterableDataset, CaptureMapDataset, FastForwardSampler from pytorch_lightning.utilities.enums import _FaultTolerantMode from pytorch_lightning.utilities.exceptions import MisconfigurationException -from pytorch_lightning.utilities.rank_zero import rank_zero_deprecation, rank_zero_warn, WarningCache +from pytorch_lightning.utilities.rank_zero import rank_zero_warn, WarningCache # might be supported in later releases, see https://github.com/python/mypy/pull/13297 BType = Union[Tensor, str, Mapping[Any, "BType"], Iterable["BType"]] # type: ignore[misc] @@ -421,19 +421,3 @@ def _is_dataloader_shuffled(dataloader: object) -> bool: if isinstance(sampler, SequentialSampler): return False return isinstance(sampler, RandomSampler) - - -def has_iterable_dataset(*args: Any, **kwargs: Any) -> Any: - rank_zero_deprecation( - "`pytorch_lightning.utilities.data.has_iterable_dataset` has been deprecated in v1.8.0 and will be" - " removed in v2.0.0. Please use `lightning_fabric.utilities.data.has_iterable_dataset` instead." - ) - return new_has_iterable_dataset(*args, **kwargs) - - -def has_len(*args: Any, **kwargs: Any) -> Any: - rank_zero_deprecation( - "`pytorch_lightning.utilities.data.has_len` has been deprecated in v1.8.0 and will be" - " removed in v2.0.0. Please use `lightning_fabric.utilities.data.has_len` instead." - ) - return new_has_len(*args, **kwargs) diff --git a/tests/tests_pytorch/deprecated_api/test_remove_2-0.py b/tests/tests_pytorch/deprecated_api/test_remove_2-0.py deleted file mode 100644 index b3b628408df2f..0000000000000 --- a/tests/tests_pytorch/deprecated_api/test_remove_2-0.py +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright The PyTorch Lightning team. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Test deprecated functionality which will be removed in v2.0.0.""" -import pytest -from torch.utils.data import DataLoader - -from pytorch_lightning.demos.boring_classes import RandomDataset -from pytorch_lightning.utilities.data import has_iterable_dataset, has_len - - -def test_v1_10_deprecated_data_utilities(): - with pytest.deprecated_call(match="data.has_iterable_dataset` has been deprecated in v1.8.0"): - has_iterable_dataset(DataLoader(RandomDataset(2, 4))) - - with pytest.deprecated_call(match="data.has_len` has been deprecated in v1.8.0"): - has_len(DataLoader(RandomDataset(2, 4)))