Template Class StatefulDataLoader¶
Defined in File stateful.h
Page Contents
Inheritance Relationships¶
Base Type¶
public torch::data::DataLoaderBase< Dataset, Dataset::BatchType::value_type, Dataset::BatchRequestType >
(Template Class DataLoaderBase)
Class Documentation¶
-
template<typename
Dataset
>
classtorch::data
::
StatefulDataLoader
: public torch::data::DataLoaderBase<Dataset, Dataset::BatchType::value_type, Dataset::BatchRequestType>¶ A dataloader for stateful datasets.
A dataloader for stateful datatasets differs from one for stateless datasets one in that the dataset is shared among worker threads, and that this dataset is itself responsible for producing batches rather than depending on a sampler. The statefulness here actually refers to the dataset. The StatefulDataLoader simply alters the data loading algorithm to accommodate the stateful, shared nature of the dataset. Note that the dataset must be thread safe if more than one worker thread is used.
A stateful dataloader is created by calling
make_data_loader
with a stateful dataset.Public Types
-
using
super
= DataLoaderBase<Dataset, typename Dataset::BatchType::value_type, typename Dataset::BatchRequestType>¶
-
using
BatchRequestType
= BatchRequest¶
Public Functions
-
StatefulDataLoader
(Dataset dataset, DataLoaderOptions options)¶ Constructs the
StatefulDataLoader
from adataset
and someoptions
.
-
using