diff --git a/src/pytorch_lightning/CHANGELOG.md b/src/pytorch_lightning/CHANGELOG.md index a4c23a95c6..a9d5267614 100644 --- a/src/pytorch_lightning/CHANGELOG.md +++ b/src/pytorch_lightning/CHANGELOG.md @@ -67,6 +67,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). * env_prefix * env_parse +- Removed the deprecated code in `pl.core.mixins` ([#16424](https://github.com/Lightning-AI/lightning/pull/16424)) + - Removed the deprecated code in `pl.utilities.distributed` ([#16390](https://github.com/Lightning-AI/lightning/pull/16390)) - Removed the deprecated code in `pl.utilities.apply_func` ([#16413](https://github.com/Lightning-AI/lightning/pull/16413)) diff --git a/src/pytorch_lightning/core/mixins/__init__.py b/src/pytorch_lightning/core/mixins/__init__.py index 1f19bd6e71..cc2573d6fd 100644 --- a/src/pytorch_lightning/core/mixins/__init__.py +++ b/src/pytorch_lightning/core/mixins/__init__.py @@ -11,6 +11,4 @@ # 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. - -from lightning_fabric.utilities.device_dtype_mixin import _DeviceDtypeModuleMixin # noqa: F401 from pytorch_lightning.core.mixins.hparams_mixin import HyperparametersMixin # noqa: F401 diff --git a/src/pytorch_lightning/core/mixins/device_dtype_mixin.py b/src/pytorch_lightning/core/mixins/device_dtype_mixin.py deleted file mode 100644 index e6e8a489e8..0000000000 --- a/src/pytorch_lightning/core/mixins/device_dtype_mixin.py +++ /dev/null @@ -1,25 +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. - -from lightning_fabric.utilities.device_dtype_mixin import _DeviceDtypeModuleMixin -from pytorch_lightning.utilities import rank_zero_deprecation - - -class DeviceDtypeModuleMixin(_DeviceDtypeModuleMixin): - def __init__(self) -> None: - rank_zero_deprecation( - "`pytorch_lightning.core.mixins.DeviceDtypeModuleMixin` has been deprecated in v1.8.0 and will be" - " removed in v2.0.0. This class is internal but you can copy over its implementation." - ) - super().__init__() diff --git a/tests/tests_pytorch/deprecated_api/test_remove_2-0.py b/tests/tests_pytorch/deprecated_api/test_remove_2-0.py index 3a7dc20a43..ee96160aba 100644 --- a/tests/tests_pytorch/deprecated_api/test_remove_2-0.py +++ b/tests/tests_pytorch/deprecated_api/test_remove_2-0.py @@ -17,7 +17,6 @@ import torch from torch.utils.data import DataLoader from pytorch_lightning.accelerators.cpu import CPUAccelerator -from pytorch_lightning.core.mixins.device_dtype_mixin import DeviceDtypeModuleMixin from pytorch_lightning.demos.boring_classes import RandomDataset from pytorch_lightning.strategies.utils import on_colab_kaggle from pytorch_lightning.utilities.cloud_io import atomic_save, get_filesystem, load @@ -31,14 +30,6 @@ def test_v1_10_deprecated_on_colab_kaggle_func(): on_colab_kaggle() -def test_v1_10_deprecated_device_dtype_module_mixin(): - class MyModule(DeviceDtypeModuleMixin): - pass - - with pytest.deprecated_call(match="mixins.DeviceDtypeModuleMixin` has been deprecated in v1.8.0"): - MyModule() - - def test_v1_10_deprecated_cloud_io_utilities(tmpdir): with pytest.deprecated_call(match="cloud_io.atomic_save` has been deprecated in v1.8.0"): atomic_save({}, tmpdir / "atomic_save.ckpt")