Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Diuven committed Aug 8, 2020
1 parent c0ad792 commit 84ffdd3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pytorch_lightning/metrics/functional/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ def stat_scores_multiple_classes(
num_classes = get_num_classes(pred=pred, target=target, num_classes=num_classes)

if pred.dtype != torch.bool:
pred.clamp_max_(max=num_classes)
pred = pred.clamp_max(max=num_classes)
if target.dtype != torch.bool:
target.clamp_max_(max=num_classes)
target = target.clamp_max(max=num_classes)

possible_reductions = ('none', 'sum', 'elementwise_mean')
if reduction not in possible_reductions:
Expand Down

0 comments on commit 84ffdd3

Please sign in to comment.