Skip to content

Commit 6c77725

Browse files
committed
minor fixes
Signed-off-by: ytl0623 <[email protected]>
1 parent 52ccd35 commit 6c77725

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

monai/losses/unified_focal_loss.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,9 @@ def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor:
242242
Args:
243243
y_pred : the shape should be BNH[WD], where N is the number of classes.
244244
The input should be the original logits since it will be transformed by
245-
a sigmoid in the forward function.
245+
a sigmoid/softmax in the forward function.
246246
y_true : the shape should be BNH[WD], where N is the number of classes.
247-
248-
Raises:
249-
ValueError: When input and target are different shape
250247
"""
251-
if y_pred.shape != y_true.shape:
252-
raise ValueError(f"ground truth has different shape ({y_true.shape}) from input ({y_pred.shape})")
253248

254249
asy_focal_loss = self.asy_focal_loss(y_pred, y_true)
255250
asy_focal_tversky_loss = self.asy_focal_tversky_loss(y_pred, y_true)

0 commit comments

Comments
 (0)