Skip to content

Commit 8bff9b4

Browse files
Update monai/transforms/post/dictionary.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: sewon jeon <[email protected]>
1 parent 4fc0116 commit 8bff9b4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

monai/transforms/post/dictionary.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,8 @@ def _determine_shape(
684684
raise ValueError(f"{self._ERR_INVALID_POINTS} Got {points_t.ndim}D tensor.")
685685
spatial_dims = int(points_t.shape[-1])
686686
if static_shape is not None:
687+
if len(static_shape) == 1 and spatial_dims > 1:
688+
static_shape = tuple([static_shape[0]] * spatial_dims)
687689
if len(static_shape) != spatial_dims:
688690
raise ValueError(
689691
f"Provided static spatial_shape has {len(static_shape)} dims; expected {spatial_dims}."

0 commit comments

Comments
 (0)