Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Mar 17, 2021
1 parent 5be1ec1 commit 48eb05a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/deprecated_api/test_remove_1-5_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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()

Expand Down

0 comments on commit 48eb05a

Please sign in to comment.