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 12c8b87 commit 7c51086Copy full SHA for 7c51086
torchvision/ops/focal_loss.py
@@ -34,8 +34,7 @@ def sigmoid_focal_loss(
34
# Original implementation from https://github.com/facebookresearch/fvcore/blob/master/fvcore/nn/focal_loss.py
35
36
# Check reduction option
37
- modes = ["none", "mean", "sum"]
38
- if reduction not in modes:
+ if reduction != "none" or reduction != "mean" or reduction != "sum":
39
raise ValueError(
40
f"Invalid Value for arg 'reduction': '{reduction} \n Supported reduction modes: 'none', 'mean', 'sum'"
41
)
0 commit comments