diff --git a/monai/transforms/spatial/array.py b/monai/transforms/spatial/array.py index 2f8e6cefe7..44d5c6ffa3 100644 --- a/monai/transforms/spatial/array.py +++ b/monai/transforms/spatial/array.py @@ -3476,7 +3476,7 @@ def __init__( upsample_mode: InterpolateMode | str = InterpolateMode.TRILINEAR, zoom_range: Sequence[float] = (0.5, 1.0), align_corners=False, - device: Optional[torch.device] = None, + device: torch.device | None = None, ) -> None: """ Args: @@ -3500,7 +3500,7 @@ def __init__( self.device = device self.zoom_factor = 1 - def randomize(self, data: Optional[Any] = None) -> None: + def randomize(self, data: Any | None = None) -> None: super().randomize(None) self.zoom_factor = self.R.uniform(self.zoom_range[0], self.zoom_range[1]) if not self._do_transform: diff --git a/monai/transforms/spatial/dictionary.py b/monai/transforms/spatial/dictionary.py index 47270e38f0..436fb280c3 100644 --- a/monai/transforms/spatial/dictionary.py +++ b/monai/transforms/spatial/dictionary.py @@ -2582,7 +2582,7 @@ def __init__( def set_random_state( self, seed: int | None = None, state: np.random.RandomState | None = None - ) -> "RandSimulateLowResolutiond": + ) -> RandSimulateLowResolutiond: super().set_random_state(seed, state) return self