MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / __init__

Method __init__

monai/transforms/post/array.py:1060–1074  ·  view source on GitHub ↗
(
        self,
        kernel_size: int = 3,
        spatial_axes: Sequence[int] | int | None = None,
        normalize_kernels: bool = True,
        normalize_gradients: bool = False,
        padding_mode: str = "reflect",
        dtype: torch.dtype = torch.float32,
    )

Source from the content-addressed store, hash-verified

1058 backend = [TransformBackends.TORCH]
1059
1060 def __init__(
1061 self,
1062 kernel_size: int = 3,
1063 spatial_axes: Sequence[int] | int | None = None,
1064 normalize_kernels: bool = True,
1065 normalize_gradients: bool = False,
1066 padding_mode: str = "reflect",
1067 dtype: torch.dtype = torch.float32,
1068 ) -> None:
1069 super().__init__()
1070 self.padding = padding_mode
1071 self.spatial_axes = spatial_axes
1072 self.normalize_kernels = normalize_kernels
1073 self.normalize_gradients = normalize_gradients
1074 self.kernel_diff, self.kernel_smooth = self._get_kernel(kernel_size, dtype)
1075
1076 def _get_kernel(self, size, dtype) -> tuple[torch.Tensor, torch.Tensor]:
1077 if size < 3:

Callers

nothing calls this directly

Calls 2

_get_kernelMethod · 0.95
__init__Method · 0.45

Tested by

no test coverage detected