Skip to content

Commit 584c915

Browse files
committed
Docs: condition shape constraints on isotropic/anisotropic mode
1 parent 28ab77c commit 584c915

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

monai/networks/nets/segresnet_ds.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -255,19 +255,23 @@ class SegResNetDS(nn.Module):
255255
Otherwise, by default, the kernel size and downsampling is always isotropic.
256256
257257
Spatial shape constraints:
258-
The input spatial dimensions must be divisible by ``2 ** (len(blocks_down) - 1)``.
259-
With the default ``blocks_down=(1, 2, 2, 4)`` (4 levels), each spatial dimension
260-
must be divisible by 8.
258+
If ``resolution is None`` (isotropic downsampling), each input spatial dimension
259+
must be divisible by ``2 ** (len(blocks_down) - 1)``.
260+
With the default ``blocks_down=(1, 2, 2, 4)`` (4 levels), each spatial dimension
261+
must be divisible by 8.
261262
262-
Use :py:meth:`shape_factor` to query the required divisors for a given configuration,
263-
and :py:meth:`is_valid_shape` to check whether a specific input tensor satisfies them.
263+
If ``resolution`` is provided, divisibility can differ by dimension based on
264+
anisotropic scales; use :py:meth:`shape_factor` for the exact required factors.
264265
265-
Example::
266+
Use :py:meth:`shape_factor` to query the required divisors for a given configuration,
267+
and :py:meth:`is_valid_shape` to check whether a specific input tensor satisfies them.
266268
267-
model = SegResNetDS(spatial_dims=3, blocks_down=(1, 2, 2, 4))
268-
print(model.shape_factor()) # [8, 8, 8]
269-
# Valid input: shape (1, 1, 128, 128, 128) -- all dims divisible by 8
270-
# Invalid input: shape (1, 1, 100, 100, 100) -- 100 is not divisible by 8
269+
Example::
270+
271+
model = SegResNetDS(spatial_dims=3, blocks_down=(1, 2, 2, 4))
272+
print(model.shape_factor()) # [8, 8, 8]
273+
# Valid input: shape (1, 1, 128, 128, 128) -- all dims divisible by 8
274+
# Invalid input: shape (1, 1, 100, 100, 100) -- 100 is not divisible by 8
271275
272276
"""
273277

0 commit comments

Comments
 (0)