Tensor
The Tensor structure provides a comprehensive representation of a multi-dimensional array used in computational frameworks. It allows for flexible creation, parameter configuration (e.g., for convolution or pooling operations), and manipulation of tensors. By including additional features like scaling, biasing, and various operation parameters, it becomes a powerful tool for numerical computation and machine learning tasks.
#include <parallel/TellusimTensorGraph.h>
Constructors
Tensor()
explicit Tensor(Buffer *buffer, size_t offset = 0)
explicit Tensor(Format format, uint32_t width = 0, uint32_t height = 1, uint32_t depth = 1, uint32_t layers = 1)
Tensor(Buffer *buffer, Format format, uint32_t width = 0, uint32_t height = 1, uint32_t depth = 1, uint32_t layers = 1)
Tensor(const Tensor &t)
Tensor(const Tensor &t, uint32_t width, uint32_t height = 1, uint32_t depth = 1, uint32_t layers = 1)
Methods
Check tensor.
bool isValid() const
operator bool() const
Tensor size.
uint32_t getSize() const
size_t getBytes() const
Set operation parameters.
Tensor setAxis(uint32_t axis) const
Tensor setKernel(uint32_t kernel) const
Tensor setStride(uint32_t stride) const
Tensor setPadding(uint32_t padding) const
Tensor setDilation(uint32_t dilation) const
Set value parameters.
Tensor setScaleBias(float32_t scale, float32_t bias) const
Tensor setScale(float32_t scale) const
Tensor setBias(float32_t bias) const
Variables
Type | Name | Value | Description |
---|---|---|---|
Buffer | buffer | nullptr | Buffer pointer. |
Format | format | FormatUnknown | Buffer format. |
size_t | offset | 0 | Buffer offset. |
uint32_t | axis | 0 | Operation axis. |
uint32_t | kernel | 2 | Operation kernel. |
uint32_t | stride | 1 | Operation stride. |
uint32_t | padding | 0 | Operation padding. |
uint32_t | dilation | 1 | Operation dilation. |
float32_t | scale | 1.0f | Value scale. |
float32_t | bias | 0.0f | Value bias. |