Skip to content

Commit

Permalink
Fixed tensor copy to remove UserWarning (#476)
Browse files Browse the repository at this point in the history
Co-authored-by: Nishant Prabhu <nishant.p@perfios.com>
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
  • Loading branch information
3 people authored Aug 24, 2021
1 parent 3257c60 commit 03a8520
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def _precision_recall_curve_compute_single_class(

recall = torch.cat([reversed(recall[sl]), torch.zeros(1, dtype=recall.dtype, device=recall.device)])

thresholds = tensor(reversed(thresholds[sl]))
thresholds = reversed(thresholds[sl]).detach().clone() # type: ignore

return precision, recall, thresholds

Expand Down

0 comments on commit 03a8520

Please sign in to comment.