dynamically compute the pad width according to the spatial shape. the output is the amount of padding for all dimensions including the channel. Args: spatial_shape: spatial shape of the original image.
(self, spatial_shape: Sequence[int])
| 119 | self.kwargs = kwargs |
| 120 | |
| 121 | def compute_pad_width(self, spatial_shape: Sequence[int]) -> tuple[tuple[int, int]]: |
| 122 | """ |
| 123 | dynamically compute the pad width according to the spatial shape. |
| 124 | the output is the amount of padding for all dimensions including the channel. |
| 125 | |
| 126 | Args: |
| 127 | spatial_shape: spatial shape of the original image. |
| 128 | |
| 129 | """ |
| 130 | raise NotImplementedError(f"subclass {self.__class__.__name__} must implement this method.") |
| 131 | |
| 132 | def __call__( # type: ignore[override] |
| 133 | self, |