Template Class BatchDataset¶
Defined in File base.h
Page Contents
Inheritance Relationships¶
Derived Types¶
public torch::data::datasets::Dataset< MNIST >
(Template Class Dataset)public torch::data::datasets::Dataset< TensorDataset, TensorExample >
(Template Class Dataset)public torch::data::datasets::StatefulDataset< ChunkDataset< ChunkReader, samplers::RandomSampler, samplers::RandomSampler >, ChunkReader::BatchType, size_t >
(Template Class StatefulDataset)
Class Documentation¶
-
template<typename Self, typename Batch = std::vector<Example<>>, typename BatchRequest = ArrayRef<size_t>>
class BatchDataset¶ A dataset that can yield data only in batches.
Subclassed by torch::data::datasets::Dataset< MNIST >, torch::data::datasets::Dataset< TensorDataset, TensorExample >, torch::data::datasets::StatefulDataset< ChunkDataset< ChunkReader, samplers::RandomSampler, samplers::RandomSampler >, ChunkReader::BatchType, size_t >
Public Functions
-
virtual ~BatchDataset() = default¶
-
virtual Batch get_batch(BatchRequest request) = 0¶
Returns a batch of data given an index.
-
virtual std::optional<size_t> size() const = 0¶
Returns the size of the dataset, or an empty std::optional if it is unsized.
-
template<typename TransformType>
inline MapDataset<Self, TransformType> map(TransformType transform) &¶ Creates a
MapDataset
that applies the giventransform
to this dataset.
-
template<typename TransformType>
inline MapDataset<Self, TransformType> map(TransformType transform) &&¶ Creates a
MapDataset
that applies the giventransform
to this dataset.
Public Static Attributes
-
static constexpr bool is_stateful = detail::is_optional<BatchType>::value¶
-
virtual ~BatchDataset() = default¶