AIfES 2  2.0.0
aitensor Struct Reference

A tensor in AIfES. More...

#include <aifes_math.h>

Data Fields

const aimath_dtype_tdtype
 The datatype of the tensor, e.g. More...
 
uint8_t dim
 The number of dimensions.
 
uint16_t * shape
 An array of dim elements with the shape of the tensor for example [2, 3].
 
void * tensor_params
 Parameters to describe some data properties (for example quantization parameters like zero_point and shift) defined by the dtype.
 
void * data
 Pointer to the actual tensor data.
 

Detailed Description

A tensor in AIfES.

This is the main structure to do the calculations with. It represets a tensor (a N-dimensional array) of data values of the given type.

For example the matrix

\[ \left( \begin{array}{rrr} 0 & 1 & 2 \\ 3 & 4 & 5 \end{array}\right) \]

can be created with

float example_data[] = {0.0f, 1.0f, 2.0f,
3.0f, 4.0f, 5.0f};
uint16_t example_shape[] = {2, 3};
aitensor_t example_tensor = {
.dim = 2,
.shape = example_shape,
.data = example_data
};
const aimath_dtype_t * aif32
The F32 data-type indicator.
A tensor in AIfES.
Definition: aifes_math.h:89
const aimath_dtype_t * dtype
The datatype of the tensor, e.g.
Definition: aifes_math.h:90

Field Documentation

◆ dtype

const aimath_dtype_t* dtype

The datatype of the tensor, e.g.

aif32, aiq7, aiq31, aiu8


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