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 f3baeff commit 1409c00Copy full SHA for 1409c00
torchvision/ops/focal_loss.py
@@ -33,7 +33,7 @@ def sigmoid_focal_loss(
33
"""
34
# Original implementation from https://github.com/facebookresearch/fvcore/blob/master/fvcore/nn/focal_loss.py
35
36
- if not (0 <= alpha <= 1) or alpha != -1:
+ if not (0 <= alpha <= 1) and alpha != -1:
37
raise ValueError(f"Invalid alpha value: {alpha}. alpha must be in the range [0,1] or -1 for ignore.")
38
39
if not torch.jit.is_scripting() and not torch.jit.is_tracing():
0 commit comments