Skip to content

Commit 7bd2e53

Browse files
committed
typo
1 parent 0d20748 commit 7bd2e53

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

torchdata/nodes/map.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ class _SingleThreadedMapper(Iterator[T]):
485485
- any other item: return the item
486486
487487
A Bounded semaphore is used to limit concurrency and memory utilization.
488-
If N items have been pulled from the source (i.e. acquire the semaphones),
488+
If N items have been pulled from the source (i.e. acquire the semaphore),
489489
and M items have been yielded by this iterator (i.e. release the semaphore),
490490
we maintain the invariant that semaphore.value + (M - N) == prefetch_factor (modulo
491491
non-atomicness of operations).

torchdata/nodes/snapshot_store.py

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def append(self, snapshot: Any, version: int) -> None:
5858
def pop_version(self, version: int) -> Optional[Any]:
5959
ver, val = None, None
6060
with self._lock:
61+
# pop all items that have a lesser version index
6162
while self._q.queue and version >= self._q.queue[0][0]:
6263
ver, val = self._q.get_nowait()
6364

0 commit comments

Comments
 (0)