Template Class MapDataset¶
Defined in File base.h
Page Contents
Inheritance Relationships¶
Base Type¶
public torch::data::datasets::BatchDataset< MapDataset< SourceDataset, AppliedTransform >, detail::optional_if_t< SourceDataset::is_stateful, AppliedTransform::OutputBatchType >, SourceDataset::BatchRequestType >
(Template Class BatchDataset)
Class Documentation¶
-
template<typename
SourceDataset
, typenameAppliedTransform
>
classtorch::data::datasets
::
MapDataset
: public torch::data::datasets::BatchDataset<MapDataset<SourceDataset, AppliedTransform>, detail::optional_if_t<SourceDataset::is_stateful, AppliedTransform::OutputBatchType>, SourceDataset::BatchRequestType>¶ A
MapDataset
is a dataset that applies a transform to a source dataset.Public Types
-
using
DatasetType
= SourceDataset¶
-
using
TransformType
= AppliedTransform¶
-
using
BatchRequestType
= typename SourceDataset::BatchRequestType¶
-
using
OutputBatchType
= detail::optional_if_t<SourceDataset::is_stateful, typename AppliedTransform::OutputBatchType>¶
Public Functions
-
MapDataset
(DatasetType dataset, TransformType transform)¶
-
OutputBatchType
get_batch
(BatchRequestType indices) override¶ Gets a batch from the source dataset and applies the transform to it, returning the result.
-
optional< size_t > size () const noexceptoverride
Returns the size of the source dataset.
-
void
reset
()¶ Calls
reset()
on the underlying dataset.NOTE: Stateless datasets do not have a reset() method, so a call to this method will only compile for stateful datasets (which have a reset() method).
-
const SourceDataset &
dataset
() noexcept¶ Returns the underlying dataset.
-
const AppliedTransform &
transform
() noexcept¶ Returns the transform being applied.
-
using