Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: YunLiu <[email protected]>
  • Loading branch information
KumoLiu committed Nov 1, 2024
1 parent c1ceea3 commit 05816d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions monai/transforms/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ def apply_transform(
Union[List[ReturnType], ReturnType]: The return type of `transform` or a list thereof.
"""
try:
if isinstance(data, (list, tuple)) and map_items:
return [_apply_transform(transform, item, unpack_items, lazy, overrides, log_stats) for item in data]
if not map_items:
return _apply_transform(transform, data, unpack_items, lazy, overrides, log_stats)
if isinstance(data, (list, tuple)):
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:
# if in debug mode, don't swallow exception so that the breakpoint
Expand Down

0 comments on commit 05816d5

Please sign in to comment.