We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e43ceb6 commit 310a862Copy full SHA for 310a862
segmentation_models_pytorch/losses/_functional.py
@@ -66,7 +66,7 @@ def focal_loss_with_logits(
66
References:
67
https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/loss/losses.py
68
"""
69
- target = target.type(output.type())
+ target = target.to(dtype=output.dtype, device=output.device)
70
71
logpt = F.binary_cross_entropy_with_logits(output, target, reduction="none")
72
pt = torch.exp(-logpt)
0 commit comments