Skip to content

Commit

Permalink
fix: unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
rittik9 committed Feb 7, 2025
1 parent 84e3ae7 commit 2ed684f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/precision_recall_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def compute(self) -> tuple[Tensor, Tensor, Tensor]:
"""Compute metric."""
if self.thresholds is None:
if not self.preds or not self.target:
return torch.tensor([]), torch.tensor([]), torch.tensor([])
return torch.zeros(1), torch.zeros(1), torch.zeros(0)
state = (torch.cat(self.preds), torch.cat(self.target))
self.preds.clear()
self.target.clear()
Expand Down

0 comments on commit 2ed684f

Please sign in to comment.