Skip to content

Commit 6d52c3c

Browse files
林旻佑林旻佑
authored andcommitted
Fix: cleanup utils import/export and robust channel-last handling in DiceHelper (refs #8366)
Signed-off-by: 林旻佑 <[email protected]>
1 parent 51eeb65 commit 6d52c3c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

monai/inferers/utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@
3838

3939
__all__ = ["sliding_window_inference"]
4040

41-
dfrom typing import Optional, Tuple
42-
import torch
43-
4441
def ensure_channel_first(
4542
x: torch.Tensor,
4643
spatial_ndim: Optional[int] = None,
@@ -105,6 +102,8 @@ def ensure_channel_first(
105102
raise ValueError(
106103
f"cannot infer channel dim for shape={tuple(x.shape)}; expected [N,C,spatial...] or [N,spatial...,C]"
107104
)
105+
106+
108107

109108
def sliding_window_inference(
110109
inputs: torch.Tensor | MetaTensor,

0 commit comments

Comments
 (0)