Skip to content

Commit 0ba147d

Browse files
awaelchlilexierule
authored andcommitted
Deprecate moved warning functions (#8085)
1 parent 1a6709d commit 0ba147d

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
66

7+
78
## [1.3.7] - 2021-06-22
89

910
- Fixed a bug where skipping an optimizer while using amp causes amp to trigger an assertion error ([#7975](https://github.com/PyTorchLightning/pytorch-lightning/pull/7975))
1011
- Fixed deprecation messages not showing due to incorrect stacklevel ([#8002](https://github.com/PyTorchLightning/pytorch-lightning/pull/8002), [#8005](https://github.com/PyTorchLightning/pytorch-lightning/pull/8005))
1112
- Fixed setting a `DistributedSampler` when using a distributed plugin in a custom accelerator ([#7814](https://github.com/PyTorchLightning/pytorch-lightning/pull/7814))
1213
- Improved `PyTorchProfiler` chrome traces names ([#8009](https://github.com/PyTorchLightning/pytorch-lightning/pull/8009))
1314
- Fixed moving the best score to device in `EarlyStopping` callback for TPU devices ([#7959](https://github.com/PyTorchLightning/pytorch-lightning/pull/7959))
15+
- Fixed backward compatibility of moved functions `rank_zero_warn` and `rank_zero_deprecation` ([#8085](https://github.com/PyTorchLightning/pytorch-lightning/pull/8085))
16+
1417

1518
## [1.3.6] - 2021-06-15
1619

pytorch_lightning/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import time
22

33
_this_year = time.strftime("%Y")
4-
__version__ = '1.3.7'
4+
__version__ = '1.3.7post0'
55
__author__ = 'William Falcon et al.'
66
__author_email__ = '[email protected]'
77
__license__ = 'Apache-2.0'

pytorch_lightning/utilities/distributed.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,24 @@ def _get_rank() -> int:
6565
rank_zero_only.rank = getattr(rank_zero_only, 'rank', _get_rank())
6666

6767

68+
def rank_zero_warn(*args, stacklevel: int = 5, **kwargs):
69+
from pytorch_lightning.utilities.warnings import rank_zero_deprecation, rank_zero_warn
70+
rank_zero_deprecation(
71+
'`pytorch_lightning.utilities.distributed.rank_zero_warn` has been moved to'
72+
' `pytorch_lightning.utilities.rank_zero_warn` in v1.3.7 and will be removed in v1.6'
73+
)
74+
return rank_zero_warn(*args, stacklevel=stacklevel, **kwargs)
75+
76+
77+
def rank_zero_deprecation(*args, stacklevel: int = 5, **kwargs):
78+
from pytorch_lightning.utilities.warnings import rank_zero_deprecation
79+
rank_zero_deprecation(
80+
'`pytorch_lightning.utilities.distributed.rank_zero_deprecation` has been moved to'
81+
' `pytorch_lightning.utilities.rank_zero_deprecation` in v1.3.7 and will be removed in v1.6'
82+
)
83+
return rank_zero_deprecation(*args, stacklevel=stacklevel, **kwargs)
84+
85+
6886
def _info(*args, stacklevel: int = 2, **kwargs):
6987
if python_version() >= "3.8.0":
7088
kwargs['stacklevel'] = stacklevel

0 commit comments

Comments
 (0)