diff --git a/pytorch_lightning/core/lightning.py b/pytorch_lightning/core/lightning.py index 086e3cf1acd6e8..a40fe0cac14fc2 100644 --- a/pytorch_lightning/core/lightning.py +++ b/pytorch_lightning/core/lightning.py @@ -1963,8 +1963,8 @@ def model_size(self) -> float: Will be removed in v1.7.0 """ rank_zero_deprecation( - 'The `LightningModule.model_size` property was deprecated in v1.5 and will be removed in v1.7. Please ' - 'use the get_model_size method under utilities/model_helpers.py' + "The `LightningModule.model_size` property was deprecated in v1.5 and will be removed in v1.7. Please " + "use the get_model_size method under utilities/model_helpers.py" ) tmp_name = f"{uuid.uuid4().hex}.pt" diff --git a/pytorch_lightning/utilities/memory.py b/pytorch_lightning/utilities/memory.py index f50d965711caac..ab8fae40213071 100644 --- a/pytorch_lightning/utilities/memory.py +++ b/pytorch_lightning/utilities/memory.py @@ -13,8 +13,8 @@ # limitations under the License. import gc -import uuid import os +import uuid import torch from torch.nn import Module diff --git a/tests/callbacks/test_quantization.py b/tests/callbacks/test_quantization.py index 3867e962b740cb..5d39cff53d33d3 100644 --- a/tests/callbacks/test_quantization.py +++ b/tests/callbacks/test_quantization.py @@ -20,8 +20,8 @@ from pytorch_lightning import seed_everything, Trainer from pytorch_lightning.callbacks import QuantizationAwareTraining from pytorch_lightning.metrics.functional.mean_relative_error import mean_relative_error -from pytorch_lightning.utilities.memory import get_model_size_mb from pytorch_lightning.utilities.exceptions import MisconfigurationException +from pytorch_lightning.utilities.memory import get_model_size_mb from tests.helpers.datamodules import RegressDataModule from tests.helpers.runif import RunIf from tests.helpers.simple_models import RegressionModel diff --git a/tests/utilities/test_memory.py b/tests/utilities/test_memory.py index 58c3538864cb84..cbf27c0a9def21 100644 --- a/tests/utilities/test_memory.py +++ b/tests/utilities/test_memory.py @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. import torch +import torch.nn as nn from pytorch_lightning.utilities.memory import get_model_size_mb, recursive_detach from tests.helpers import BoringModel -import torch.nn as nn def test_recursive_detach():