data
21 memberslucid.utils.datalucid.utils.data: dataset and dataloader utilities.
Classes
Dataset3 methodsAbstract base class for map-style datasets.
IterableDataset2 methodsBase class for iterable-style (stream) datasets.
TensorDataset3 methodsDataset wrapping one or more Tensors, indexed along their first axis.
ConcatDataset3 methodsDataset formed by concatenating several map-style datasets end-to-end.
ChainDataset2 methodsConcatenate multiple `IterableDataset` instances end-to-end.
StackDataset3 methodsBundle several map-style datasets so each index returns a stacked tuple.
Subset3 methodsView into a parent dataset restricted to a list of indices.
Sampler2 methodsAbstract base class for index samplers used by `DataLoader`.
SequentialSampler3 methodsYield indices in fixed order `0, 1, ..., len(data_source) - 1`.
RandomSampler4 methodsYield indices in random order, with or without replacement.
SubsetRandomSampler3 methodsYield a random permutation of a fixed list of indices each epoch.
WeightedRandomSampler3 methodsYield indices drawn proportionally to user-supplied weights.
BatchSampler3 methodsGroup an inner sampler's indices into mini-batches.
DistributedSampler4 methodsSubset-and-shuffle sampler for distributed training.
DataLoader3 methodsCombine a dataset with a sampler to provide iteration over mini-batches.
WorkerInfo1 methodsPer-worker context published inside a `DataLoader` worker process.
Functions
random_split→ list of SubsetRandomly split a dataset into non-overlapping `Subset` views.
collate→ Tensor or list or dict or tupleComposable collate dispatcher with user-overridable type handlers.
default_collate→ Tensor or list or dict or tupleCollate a list of samples into a batched tensor or nested structure.
default_convert→ objectRecursively convert a single sample's elements to Lucid Tensors.
get_worker_info→ WorkerInfo or NoneReturn a `WorkerInfo` object in a worker process, else `None`.