Skip to content

Commit 820ce94

Browse files
committed
fix Local variable �lpha_arg is assigned to but never used
Signed-off-by: ytl0623 <[email protected]>
1 parent 88b1182 commit 820ce94

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

monai/losses/focal_loss.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ def forward(self, input: torch.Tensor, target: torch.Tensor) -> torch.Tensor:
165165
if isinstance(self.alpha, (float, int)):
166166
alpha_arg = None
167167
warnings.warn("`include_background=False`, scalar `alpha` ignored when using softmax.")
168-
loss = softmax_focal_loss(input, target, self.gamma, self.alpha_arg)
168+
loss = softmax_focal_loss(input, target, self.gamma, alpha_arg)
169169
else:
170-
loss = sigmoid_focal_loss(input, target, self.gamma, self.alpha_arg)
170+
loss = sigmoid_focal_loss(input, target, self.gamma, alpha_arg)
171171

172172
num_of_classes = target.shape[1]
173173
if self.class_weight is not None and num_of_classes != 1:

0 commit comments

Comments
 (0)