tenzr::data::TensorDataset¶
Dataset backed by an in-memory list of tensors.
#include <dataset.h>
Inherits from tenzr::data::Dataset
Public Functions¶
| Name | |
|---|---|
| TensorDataset(std::vector< Tensor > tensors) | |
| virtual size_t | Size() const override |
| virtual DataItem | Get(size_t index) const override |
| const std::vector< Tensor > & | Tensors() const |
Additional inherited members¶
Public Functions inherited from tenzr::data::Dataset
| Name | |
|---|---|
| virtual | ~Dataset() =default |
Public Functions Documentation¶
function TensorDataset¶
Parameters:
- tensors Column tensors, all with equal dim(0).
Wrap a list of tensors whose first dimension is the shared sample count.
function Size¶
Return: Number of samples.
Reimplements: tenzr::data::Dataset::Size
function Get¶
Parameters:
- index Zero-based sample index.
- index Row index into the dataset.
Return:
- Sliced sample tensors.
- The selected row as one tensor per column.
Reimplements: tenzr::data::Dataset::Get
Fetch the tensors at index. Copy the sample at index across all columns into a new DataItem.
function Tensors¶
Return: Const reference to the wrapped tensors.