Skip to content

Commit a32afd5

Browse files
committed
fix: ensure create_ignore_mask receives Tensor in unified_focal_loss
Signed-off-by: Rusheel Sharma <rusheelhere@gmail.com>
1 parent bf3ac32 commit a32afd5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

monai/losses/unified_focal_loss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor:
261261

262262
# Preserve original target before any channel conversions so sentinel ignore
263263
# values (e.g., 255) are detected correctly on label-encoded inputs.
264-
original_y_true = y_true if self.ignore_index is not None else None
264+
original_y_true = y_true
265265

266266
# Transform binary inputs to 2-channel space
267267
if y_pred.shape[1] == 1:

0 commit comments

Comments
 (0)