Skip to content

Commit d0b4f8f

Browse files
authored
Merge branch 'main' into please_dont_modify_this_branch_unless_you_are_just_merging_with_main__
2 parents cbf5bc2 + f709766 commit d0b4f8f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchvision/ops/focal_loss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def sigmoid_focal_loss(
3333
"""
3434
# Original implementation from https://github.com/facebookresearch/fvcore/blob/master/fvcore/nn/focal_loss.py
3535

36-
if not (0 <= alpha <= 1) or alpha != -1:
36+
if not (0 <= alpha <= 1) and alpha != -1:
3737
raise ValueError(f"Invalid alpha value: {alpha}. alpha must be in the range [0,1] or -1 for ignore.")
3838

3939
if not torch.jit.is_scripting() and not torch.jit.is_tracing():

0 commit comments

Comments
 (0)