Skip to content

Commit 4166faa

Browse files
committed
fix bugs
Signed-off-by: ytl0623 <[email protected]>
1 parent f7cad77 commit 4166faa

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
@@ -286,7 +286,7 @@ def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor:
286286
y_true: Ground truth labels. Shape should match y_pred (or be indices if to_onehot_y is True).
287287
"""
288288
if y_pred.shape != y_true.shape:
289-
is_binary_logits = (y_pred.shape[1] == 1 and not self.use_softmax)
289+
is_binary_logits = y_pred.shape[1] == 1 and not self.use_softmax
290290
if not self.to_onehot_y and not is_binary_logits:
291291
raise ValueError(f"ground truth has different shape ({y_true.shape}) from input ({y_pred.shape})")
292292

0 commit comments

Comments
 (0)