#include <tensor.h>
Public Member Functions | |
TensorDataset (const std::vector< Tensor > &tensors) | |
Creates a TensorDataset from a vector of tensors. | |
TensorDataset (torch::Tensor tensor) | |
TensorExample | get (size_t index) override |
Returns a single TensorExample . | |
optional< size_t > | size () const override |
Returns the number of tensors in the dataset. | |
Public Member Functions inherited from torch::data::datasets::Dataset< TensorDataset, TensorExample > | |
std::vector< ExampleType > | get_batch (ArrayRef< size_t > indices) override |
Returns a batch of data. More... | |
Public Member Functions inherited from torch::data::datasets::BatchDataset< TensorDataset, std::vector< TensorExample > > | |
MapDataset< TensorDataset, TransformType > | map (TransformType transform)& |
Creates a MapDataset that applies the given transform to this dataset. | |
MapDataset< TensorDataset, TransformType > | map (TransformType transform)&& |
Creates a MapDataset that applies the given transform to this dataset. | |
Data Fields | |
Tensor | tensor |
Additional Inherited Members | |
Public Types inherited from torch::data::datasets::Dataset< TensorDataset, TensorExample > | |
using | ExampleType = TensorExample |
Public Types inherited from torch::data::datasets::BatchDataset< TensorDataset, std::vector< TensorExample > > | |
using | SelfType = TensorDataset |
using | BatchType = std::vector< TensorExample > |
using | BatchRequestType = ArrayRef< size_t > |
Static Public Attributes inherited from torch::data::datasets::BatchDataset< TensorDataset, std::vector< TensorExample > > | |
static constexpr bool | is_stateful |