Skip to content

Commit

Permalink
Update deprecation method to refer to utility function
Browse files Browse the repository at this point in the history
  • Loading branch information
roshikouhai committed Jul 22, 2021
1 parent bb2ce62 commit f7c5025
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pytorch_lightning/core/lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -1971,7 +1971,8 @@ def model_size(self) -> float:
Will be removed in v1.6.0
"""
rank_zero_deprecation(
'The `LightningModule.model_size` property was deprecated in v1.4 and will be removed in v1.6.'
'The `LightningModule.model_size` property was deprecated in v1.4 and will be removed in v1.6. Please '
'use the get_model_size method under utilities/model_helpers.py'
)

tmp_name = f"{uuid.uuid4().hex}.pt"
Expand Down
5 changes: 4 additions & 1 deletion tests/deprecated_api/test_remove_1-6.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,5 +326,8 @@ def test_v1_6_0_deprecated_hpc_load(tmpdir):

def test_v1_6_0_deprecated_model_size():
model = BoringModel()
with pytest.deprecated_call(match="The `LightningModule.model_size` property was deprecated in v1.4 and will be removed in v1.6."):
with pytest.deprecated_call(
match="The `LightningModule.model_size` property was deprecated in v1.4 and will be removed in v1.6. "
"Please use the get_model_size method under utilities/model_helpers.py"
):
_ = model.model_size

0 comments on commit f7c5025

Please sign in to comment.