Skip to content

Commit bd21ea0

Browse files
committed
fixes docstrings
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
1 parent ebbddab commit bd21ea0

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

monai/transforms/compose.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def eval_lazy_stack(
4343
data, upcoming, lazy_evaluation: bool = False, mode=GridSampleMode.BILINEAR, padding_mode=GridSamplePadMode.BORDER
4444
):
4545
"""
46-
Given the upcoming transform ``upcoming``, if lazy_resample is True, go through the Metatensors and
46+
Given the upcoming transform ``upcoming``, if lazy_resample is True, go through the MetaTensors and
4747
evaluate the lazy applied operations. The returned `data` will then be ready for the ``upcoming`` transform.
4848
"""
4949
if not lazy_evaluation:

monai/transforms/inverse.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ def push_pending_transform(
156156
) -> None:
157157
"""
158158
Push to MetaTensor's pending operations for later execution.
159+
159160
Args:
160161
data:
161162
key:

monai/transforms/spatial/array.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ def lazy_call(self, img, axes) -> torch.Tensor:
839839
spatial_chn_shape = [1, *convert_to_numpy(_shape, wrap_sequence=True).tolist()]
840840
_affine = self.update_meta(img, spatial_chn_shape, axes)
841841
self.push_pending_transform(img, lazy_shape=_shape, lazy_affine=_affine)
842-
return img # type: ignore
842+
return img
843843

844844
def __call__(self, img: torch.Tensor) -> torch.Tensor:
845845
"""
@@ -970,7 +970,7 @@ def __call__(
970970

971971
_mode = look_up_option(self.mode if mode is None else mode, InterpolateMode)
972972
_align_corners = self.align_corners if align_corners is None else align_corners
973-
img = convert_to_tensor(img, track_meta=get_track_meta()) # type: ignore
973+
img = convert_to_tensor(img, track_meta=get_track_meta())
974974
original_sp_size = img.peek_pending_shape() if isinstance(img, MetaTensor) else img.shape[1:]
975975
if self.lazy_evaluation:
976976
if anti_aliasing:
@@ -1192,7 +1192,7 @@ def lazy_call(self, img, output_shape, transform_t, mode, padding_mode, align_co
11921192
"dtype": str(dtype)[6:],
11931193
},
11941194
)
1195-
return img # type: ignore
1195+
return img
11961196

11971197
def update_meta(self, img, rotate_mat):
11981198
affine = convert_to_tensor(img.peek_pending_affine(), track_meta=False)
@@ -1370,7 +1370,7 @@ def lazy_call(self, img, zoom_size, mode, align_corners) -> torch.Tensor:
13701370
"padcrop": {},
13711371
},
13721372
)
1373-
return img # type: ignore
1373+
return img
13741374

13751375
def inverse(self, data: torch.Tensor) -> torch.Tensor:
13761376
transform = self.pop_transform(data)

monai/transforms/spatial/dictionary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ def __call__(self, data: Mapping[Hashable, NdarrayOrTensor]) -> dict[Hashable, N
920920
self.rand_affine.randomize()
921921

922922
item = d[first_key]
923-
spatial_size = item.peek_pending_shape() if isinstance(item, MetaTensor) else item.shape[1:] # type: ignore
923+
spatial_size = item.peek_pending_shape() if isinstance(item, MetaTensor) else item.shape[1:]
924924

925925
sp_size = fall_back_tuple(self.rand_affine.spatial_size, spatial_size)
926926
# change image size or do random transform

0 commit comments

Comments
 (0)