Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
- fixes IOU for pytorch 1.0 (fixes #155)
Browse files Browse the repository at this point in the history
  • Loading branch information
nasimrahaman committed Dec 19, 2018
1 parent 556ca8d commit 12378b3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions inferno/extensions/metrics/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ def forward(self, prediction, target):
raise ShapeError("Target must have the same number of dimensions as the "
"prediction, or one less. Got target.dim() = {} but "
"prediction.dim() = {}.".format(target.dim(), prediction.dim()))
# Cast onehot_targets to float if required (this is a no-op if it's already float)
onehot_targets = onehot_targets.float()
# Sharpen prediction if required to. Sharpening in this sense means to replace
# the max predicted probability with 1.
if self.sharpen_prediction:
Expand Down

0 comments on commit 12378b3

Please sign in to comment.