Skip to content

Commit

Permalink
Fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
ejguan committed Apr 21, 2023
1 parent 9abd813 commit 46de5fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions torchdata/dataloader2/reading_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ def _resume(self):
Resumes DataPipes' activities. This is required to be called after `_pause` before
the DataLoader can keep yielding elements.
"""
assert self._end_datapipe is not None

dp_list = list_dps(traverse_dps(self._end_datapipe))
# Reversed order
for dp in dp_list[::-1]:
Expand Down Expand Up @@ -435,6 +437,7 @@ def _pause(self):
in order to collect state.
"""
assert self._end_datapipe is not None

dp_list = list_dps(traverse_dps(self._end_datapipe))
for dp in dp_list:
# TODO: Combine QueueWrapper and _IterateQueueDataPipes,
Expand All @@ -451,6 +454,8 @@ def _resume(self):
Resumes DataPipes' activities. This is required to be called after `_pause` before
the DataLoader can keep yielding elements.
"""
assert self._end_datapipe is not None

self._worker_consumer_datapipe.request_resume() # type: ignore[union-attr]
dp_list = list_dps(traverse_dps(self._end_datapipe))
# Reversed order
Expand Down

0 comments on commit 46de5fa

Please sign in to comment.