Skip to content

Commit ac5c481

Browse files
committed
fix: add type ignore comment for mypy no-any-return in utils.py
Signed-off-by: Rusheel Sharma <rusheelhere@gmail.com>
1 parent 9f2a06f commit ac5c481

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

monai/metrics/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def create_ignore_mask(y: torch.Tensor, ignore_index: int | None) -> torch.Tenso
116116
num_classes = y.shape[1]
117117
if 0 <= ignore_index < num_classes:
118118
# Valid class index: exclude that channel
119-
return 1.0 - y[:, ignore_index : ignore_index + 1]
119+
return 1.0 - y[:, ignore_index : ignore_index + 1] # type: ignore[no-any-return]
120120
else:
121121
# Sentinel value: exclude where all channels are zero
122122
return (y.sum(dim=1, keepdim=True) > 0).float()

0 commit comments

Comments
 (0)