From f7c5025f8fce27d2bcd09387402711ce06a720ea Mon Sep 17 00:00:00 2001 From: Rio H Date: Wed, 21 Jul 2021 21:04:49 -0700 Subject: [PATCH] Update deprecation method to refer to utility function --- pytorch_lightning/core/lightning.py | 3 ++- tests/deprecated_api/test_remove_1-6.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pytorch_lightning/core/lightning.py b/pytorch_lightning/core/lightning.py index e947f9f7baa7b9..dd173740cf2af9 100644 --- a/pytorch_lightning/core/lightning.py +++ b/pytorch_lightning/core/lightning.py @@ -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" diff --git a/tests/deprecated_api/test_remove_1-6.py b/tests/deprecated_api/test_remove_1-6.py index c92fccc137460e..0f9c4f67abac17 100644 --- a/tests/deprecated_api/test_remove_1-6.py +++ b/tests/deprecated_api/test_remove_1-6.py @@ -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