A MapDataset
is a dataset that applies a transform to a source dataset.
More...
#include <map.h>
|
using | DatasetType = SourceDataset |
|
using | TransformType = AppliedTransform |
|
using | BatchRequestType = typename SourceDataset::BatchRequestType |
|
using | OutputBatchType = detail::optional_if_t< SourceDataset::is_stateful, typename AppliedTransform::OutputBatchType > |
|
using | SelfType = MapDataset< SourceDataset, AppliedTransform > |
|
using | BatchType = detail::optional_if_t< SourceDataset::is_stateful, AppliedTransform::OutputBatchType > |
|
using | BatchRequestType = SourceDataset::BatchRequestType |
|
|
| 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. More...
|
|
optional< size_t > | size () const noexceptoverride |
| Returns the size of the source dataset.
|
|
void | reset () |
| Calls reset() on the underlying dataset. More...
|
|
const SourceDataset & | dataset () noexcept |
| Returns the underlying dataset.
|
|
const AppliedTransform & | transform () noexcept |
| Returns the transform being applied.
|
|
virtual detail::optional_if_t< SourceDataset::is_stateful, AppliedTransform::OutputBatchType > | get_batch (SourceDataset::BatchRequestTyperequest)=0 |
| Returns a batch of data given an index.
|
|
MapDataset< MapDataset< SourceDataset, AppliedTransform >, TransformType > | map (TransformType transform)& |
| Creates a MapDataset that applies the given transform to this dataset.
|
|
MapDataset< MapDataset< SourceDataset, AppliedTransform >, TransformType > | map (TransformType transform)&& |
| Creates a MapDataset that applies the given transform to this dataset.
|
|
|
static constexpr bool | is_stateful |
|
template<typename SourceDataset, typename AppliedTransform>
class torch::data::datasets::MapDataset< SourceDataset, AppliedTransform >
A MapDataset
is a dataset that applies a transform to a source dataset.
Definition at line 18 of file base.h.
template<typename SourceDataset, typename AppliedTransform>
Gets a batch from the source dataset and applies the transform to it, returning the result.
Definition at line 41 of file map.h.
template<typename SourceDataset, typename AppliedTransform>
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).
Definition at line 54 of file map.h.
The documentation for this class was generated from the following files:
- torch/csrc/api/include/torch/data/datasets/base.h
- torch/csrc/api/include/torch/data/datasets/map.h