From 48eb05a1d8128937dc1cf5ecf15f318d1c556be1 Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Wed, 17 Mar 2021 11:47:34 +0100 Subject: [PATCH] fix --- tests/deprecated_api/test_remove_1-5_metrics.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/deprecated_api/test_remove_1-5_metrics.py b/tests/deprecated_api/test_remove_1-5_metrics.py index 3c7ce48caeea1..fb8610b62eee2 100644 --- a/tests/deprecated_api/test_remove_1-5_metrics.py +++ b/tests/deprecated_api/test_remove_1-5_metrics.py @@ -17,6 +17,7 @@ import torch from pytorch_lightning.metrics import Accuracy, MetricCollection +from pytorch_lightning.metrics.functional.accuracy import accuracy from pytorch_lightning.metrics.utils import get_num_classes, select_topk, to_categorical, to_onehot @@ -38,11 +39,11 @@ def test_v1_5_metrics_utils(): def test_v1_5_metric_accuracy(): - from pytorch_lightning.metrics.functional.accuracy import accuracy + accuracy.warned = False with pytest.deprecated_call(match='It will be removed in v1.5.0'): assert accuracy(preds=torch.tensor([0, 1]), target=torch.tensor([0, 1])) == torch.tensor(1.) - from pytorch_lightning.metrics import Accuracy + Accuracy.warned = False with pytest.deprecated_call(match='It will be removed in v1.5.0'): Accuracy()