Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
  • Loading branch information
KumoLiu committed Nov 1, 2024
1 parent 05816d5 commit c0daf6f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions monai/transforms/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ def apply_transform(
Union[List[ReturnType], ReturnType]: The return type of `transform` or a list thereof.
"""
try:
if not map_items:
return _apply_transform(transform, data, unpack_items, lazy, overrides, log_stats)
if isinstance(data, (list, tuple)):
if isinstance(data, (list, tuple)) and map_items:
return [apply_transform(transform, item, map_items, unpack_items, log_stats, lazy, overrides) for item in data]
return _apply_transform(transform, data, unpack_items, lazy, overrides, log_stats)
except Exception as e:
Expand Down

0 comments on commit c0daf6f

Please sign in to comment.