Skip to content

Commit

Permalink
Remove the deprecated code in pl.utilities.data (#16440)
Browse files Browse the repository at this point in the history
  • Loading branch information
carmocca authored Jan 20, 2023
1 parent 39acb81 commit d3de5c6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 44 deletions.
1 change: 1 addition & 0 deletions docs/source-pytorch/api_references.rst
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ utilities
:nosignatures:

argparse
data
deepspeed
distributed
finite_checks
Expand Down
2 changes: 2 additions & 0 deletions src/pytorch_lightning/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
18 changes: 1 addition & 17 deletions src/pytorch_lightning/utilities/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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)
27 changes: 0 additions & 27 deletions tests/tests_pytorch/deprecated_api/test_remove_2-0.py

This file was deleted.

0 comments on commit d3de5c6

Please sign in to comment.