Skip to content

Commit 2b72d1b

Browse files
committed
fix: Inconsistent single-channel expansion between loss components
Signed-off-by: ytl0623 <[email protected]>
1 parent 8368ef2 commit 2b72d1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

monai/losses/unified_focal_loss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor:
172172
y_true: ground truth labels.
173173
"""
174174

175-
if y_pred.shape[1] == 1 and not self.use_softmax:
175+
if y_pred.shape[1] == 1:
176176
y_pred = torch.sigmoid(y_pred)
177177
y_pred = torch.cat([1 - y_pred, y_pred], dim=1)
178178
is_already_prob = True

0 commit comments

Comments
 (0)