Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 16, 2024
1 parent e42cdcf commit ad73da5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions SandBox/issue-2656.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from torchmetrics import MultitaskWrapper, F1Score
import torch
wrapper = MultitaskWrapper({"F1": F1Score(num_classes=2, average='macro', task="multiclass")})
from torchmetrics import F1Score, MultitaskWrapper

wrapper = MultitaskWrapper({"F1": F1Score(num_classes=2, average="macro", task="multiclass")})
wrapper2 = wrapper.clone(postfix="train")
preds = {"F1": torch.ones((5, 2))}
tgt = {"F1": torch.tensor([0, 1, 0, 1, 0], dtype=torch.long)}

#wrapper(preds, tgt) # This one works
wrapper2(preds, tgt)
# wrapper(preds, tgt) # This one works
wrapper2(preds, tgt)

0 comments on commit ad73da5

Please sign in to comment.