Skip to content

Commit 67b2b1d

Browse files
committed
fixes type hint issue
Signed-off-by: Wenqi Li <[email protected]>
1 parent 6a4f68f commit 67b2b1d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

monai/networks/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import warnings
1616
from contextlib import contextmanager
17-
from typing import Any, Callable, Optional, Sequence, cast
17+
from typing import Any, Callable, Optional, Sequence
1818

1919
import torch
2020
import torch.nn as nn
@@ -86,10 +86,10 @@ def predict_segmentation(
8686
threshold: thresholding the prediction values if multi-labels task.
8787
"""
8888
if not mutually_exclusive:
89-
return (cast(torch.Tensor, logits >= threshold)).int()
89+
return (logits >= threshold).int()
9090
if logits.shape[1] == 1:
9191
warnings.warn("single channel prediction, `mutually_exclusive=True` ignored, use threshold instead.")
92-
return (cast(torch.Tensor, logits >= threshold)).int()
92+
return (logits >= threshold).int()
9393
return logits.argmax(1, keepdim=True)
9494

9595

0 commit comments

Comments
 (0)