Skip to content

Commit cb771f5

Browse files
author
Lukas Sanner
committed
Revert "fixing type and device casting"
This reverts commit 62682f0.
1 parent 0b431b0 commit cb771f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

segmentation_models_pytorch/losses/_functional.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def focal_loss_with_logits(
6666
References:
6767
https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/loss/losses.py
6868
"""
69-
target = target.to(dtype=output.dtype, device=output.device)
69+
target = target.type(output.type())
7070

7171
logpt = F.binary_cross_entropy_with_logits(output, target, reduction="none")
7272
pt = torch.exp(-logpt)

0 commit comments

Comments
 (0)