Skip to content

Commit 10b87d6

Browse files
authored
Explicit iterator shutdown (#1482)
1 parent dbf04a9 commit 10b87d6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

torchdata/nodes/map.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ def __init__(
377377
def reset(self, initial_state: Optional[Dict[str, Any]] = None):
378378
super().reset(initial_state)
379379
if self._it is not None:
380+
self._it._shutdown()
380381
del self._it
381382

382383
if self.num_workers > 0:

0 commit comments

Comments
 (0)