Skip to content

Commit c0daf6f

Browse files
committed
fix #8186
Signed-off-by: YunLiu <[email protected]>
1 parent 05816d5 commit c0daf6f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

monai/transforms/transform.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,7 @@ def apply_transform(
136136
Union[List[ReturnType], ReturnType]: The return type of `transform` or a list thereof.
137137
"""
138138
try:
139-
if not map_items:
140-
return _apply_transform(transform, data, unpack_items, lazy, overrides, log_stats)
141-
if isinstance(data, (list, tuple)):
139+
if isinstance(data, (list, tuple)) and map_items:
142140
return [apply_transform(transform, item, map_items, unpack_items, log_stats, lazy, overrides) for item in data]
143141
return _apply_transform(transform, data, unpack_items, lazy, overrides, log_stats)
144142
except Exception as e:

0 commit comments

Comments
 (0)