|
NForge
Tensor library
|
#include <tensor_layout.h>
Public Member Functions | |
| TensorLayout () | |
| Default constructor. Rank and offset are zero. | |
| TensorLayout (const Tensor::Shape &_shape) | |
| TensorLayout (const Tensor::Shape &_shape, const std::vector< size_t > &_strides) | |
| TensorLayout (const Tensor::Shape &_shape, const std::vector< size_t > &_strides, size_t _offset) | |
| TensorLayout (std::array< size_t, MAX_DIMS > _shape, std::array< size_t, MAX_DIMS > _strides, size_t _offset, size_t _rank) | |
| bool | operator== (const TensorLayout &rhs) const |
| True if layouts have equal rank, offset, and active shape/stride entries. | |
| bool | operator!= (const TensorLayout &rhs) const |
| Negation of operator==. | |
Describes the memory layout of a tensor (shape, strides, offset, rank).
Only the first rank entries of shape and strides are active. 0 <= rank && rank <= MAX_DIMS.
| TensorLayout::TensorLayout | ( | const Tensor::Shape & | _shape | ) |
Contiguous (row-major) layout from a shape.
_shape.getNumDims() <= MAX_DIMS | TensorLayout::TensorLayout | ( | const Tensor::Shape & | _shape, |
| const std::vector< size_t > & | _strides | ||
| ) |
Layout from shape and explicit strides.
_shape.getNumDims() <= MAX_DIMS _strides.size() == _shape.getNumDims() | TensorLayout::TensorLayout | ( | const Tensor::Shape & | _shape, |
| const std::vector< size_t > & | _strides, | ||
| size_t | _offset | ||
| ) |
Layout from shape, explicit strides, and storage offset.
_shape.getNumDims() <= MAX_DIMS _strides.size() == _shape.getNumDims() | TensorLayout::TensorLayout | ( | std::array< size_t, MAX_DIMS > | _shape, |
| std::array< size_t, MAX_DIMS > | _strides, | ||
| size_t | _offset, | ||
| size_t | _rank | ||
| ) |
Layout from raw arrays and rank.
_rank <= MAX_DIMS