Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions | Data Fields
torch::data::datasets::TensorDataset Struct Reference

A dataset of tensors. More...

#include <tensor.h>

Inheritance diagram for torch::data::datasets::TensorDataset:
torch::data::datasets::Dataset< TensorDataset, TensorExample > torch::data::datasets::BatchDataset< TensorDataset, std::vector< TensorExample > >

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< ExampleTypeget_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
 

Detailed Description

A dataset of tensors.

Stores a single tensor internally, which is then indexed inside get().

Definition at line 16 of file tensor.h.


The documentation for this struct was generated from the following file: