Skip to content

Commit

Permalink
Merge pull request #62 from seefun/develop
Browse files Browse the repository at this point in the history
fix bug in lovasz loss
  • Loading branch information
BloodAxe authored Aug 5, 2021
2 parents d022736 + 618d1e1 commit f050f3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytorch_toolbelt/losses/lovasz.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def _flatten_probas(probas, labels, ignore=None):
probas = probas.view(B, 1, H, W)

C = probas.size(1)
probas = torch.movedim(probas, 0, -1) # [B, C, Di, Dj, Dk...] -> [B, C, Di...Dk, C]
probas = torch.movedim(probas, 1, -1) # [B, C, Di, Dj, ...] -> [B, Di, Dj, ..., C]
probas = probas.contiguous().view(-1, C) # [P, C]

labels = labels.view(-1)
Expand Down

0 comments on commit f050f3a

Please sign in to comment.