MCPcopy Create free account
hub / github.com/apple/axlearn / dataset

Method dataset

axlearn/common/input_base.py:191–201  ·  view source on GitHub ↗

Returns the input dataset, which should produce per-feed logical batches. Each batch is a pytree of arrays which reside on host memory (i.e., leaves can be any array type which can be converted to numpy via `as_numpy_array`). The dataset should be iterable, i.e., it is expe

(self)

Source from the content-addressed store, hash-verified

189 )
190
191 def dataset(self) -> Iterable[Nested[Tensor]]:
192 """Returns the input dataset, which should produce per-feed logical batches.
193
194 Each batch is a pytree of arrays which reside on host memory (i.e., leaves can be any array
195 type which can be converted to numpy via `as_numpy_array`).
196
197 The dataset should be iterable, i.e., it is expected to support conversion to an iterator
198 via `iter(...)`. Although not strictly required, it is recommended for the iterator to be
199 checkpointable.
200 """
201 raise NotImplementedError(type(self))
202
203 def __iter__(self) -> Iterator[Nested[Tensor]]:
204 """Iterates over the input dataset.

Callers 11

__iter__Method · 0.95
test_concatenationMethod · 0.45
test_zipinputMethod · 0.45
eval_stepMethod · 0.45
test_input_dispatcherMethod · 0.45
runMethod · 0.45
__init__Method · 0.45
restore_checkpointMethod · 0.45

Calls

no outgoing calls

Tested by 6

test_concatenationMethod · 0.36
test_zipinputMethod · 0.36
test_input_dispatcherMethod · 0.36