returnn.torch.data.queued_data_iter

Data iterator on a data loader which an additional queue

class returnn.torch.data.queued_data_iter.QueuedDataIter(original_iter: Iterable[T] | Iterator[T])[source]

Wraps another iterator, and also has a queue which allows to put items back in.

extend(items: Sequence[T])[source]

Extend the queue. The next items by __next__() will be the ones from items, in the same order.