MCPcopy Create free account
hub / github.com/ray-project/ray / _IterableFromIterator

Class _IterableFromIterator

python/ray/data/iterator.py:59–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57
58
59class _IterableFromIterator(Iterable[T]):
60 def __init__(self, iterator_gen: Callable[[], Iterator[T]]):
61 """Constructs an Iterable from an iterator generator.
62
63 Args:
64 iterator_gen: A function that returns an iterator each time it
65 is called. For example, this can be a generator function.
66 """
67 self.iterator_gen = iterator_gen
68
69 def __iter__(self):
70 return self.iterator_gen()
71
72
73@PublicAPI

Callers 2

_iter_batchesMethod · 0.85
iter_rowsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…