Skip to content

Commit

Permalink
remove dataloader 2 ref
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewkho committed Sep 27, 2024
1 parent 041d645 commit 84bc578
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions torchdata/datapipes/iter/util/prefetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,10 @@ def __iter__(self):
thread.start()
self.thread = thread

# Lazily import to prevent circular import
from torchdata.dataloader2 import communication

while not prefetch_data.stop_iteration or len(prefetch_data.prefetch_buffer) > 0:
if len(prefetch_data.prefetch_buffer) > 0:
data = prefetch_data.prefetch_buffer.popleft()
if isinstance(data, Exception):
if isinstance(data, (StopIteration, communication.iter.TerminateRequired)):
break
raise data
yield data
else:
Expand Down

0 comments on commit 84bc578

Please sign in to comment.