aistore.pytorch.base_iter_dataset
aistore.pytorch.base_iter_dataset
Base class for AIS Iterable Style Datasets
Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved.
Module Contents
Classes
API
Bases: IterableDataset
A base class for creating AIS Iterable Datasets. Should not be instantiated directly. Subclasses
should implement :meth:__iter__ which returns the samples from the dataset and can optionally
override other methods from torch IterableDataset such as :meth:__len__.
Parameters:
Single or list of AISSource objects to load data
Map of AISSource objects to list of prefixes that only allows objects with the specified prefixes to be used from each source
Return iterator with samples in this dataset.
Returns: Iterator
Iterator of samples
Returns the length of the dataset. Note that calling this will iterate through the dataset, taking O(N) time.
NOTE: If you want the length of the dataset after iterating through
it, use for i, data in enumerate(dataset) instead.
Create an iterable of objects given the AIS sources and associated prefixes.
Returns: Iterable
Iterable over the objects from the sources provided
Depending on how many Torch workers are present or if they are even present at all, return an iterator for the current worker to access and a worker name.
Returns: Tuple[Iterator, str]
tuple[Iterator, str]: Iterator of objects and name of worker
Reset the object iterator to start from the beginning.