quantlab.model.torch_data.batch_loader#
- quantlab.model.torch_data.batch_loader(dataset, sampler, *, num_workers=0, pin_memory=False)[source]#
A
DataLoaderthat hands each batch of positions todataset[positions]whole.The dataset gathers the batch itself (as
SymbolSequenceDatasetdoes), so nothing is split into items and collated back: the loader runs withbatch_size=Noneoversampler’s batches.Examples
>>> loader = batch_loader(dataset, IndexBatches(len(dataset), 3)) >>> tuple(next(iter(loader)).x.shape) (3, 2, 1)