Remove the deprecated code in `pl.core.mixins` (#16424)

This commit is contained in:
Carlos Mocholí 2023-01-19 13:50:11 +01:00 committed by Luca Antiga
parent fd9a3803b8
commit 37f672d968
4 changed files with 2 additions and 36 deletions

View File

@ -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))

View File

@ -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

View File

@ -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__()

View File

@ -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")