AIfES 2
2.0.0
|
Basic data-type independent math operations. More...
Go to the source code of this file.
Functions | |
void | print_aitensor (const aitensor_t *tensor) |
Printing a tensor to console. More... | |
void | print_aiscalar (const void *scalar, const aimath_dtype_t *dtype) |
Printing a scalar to console. More... | |
void | aimath_transpose_vector (aitensor_t *vector) |
Transposes a vector. More... | |
uint32_t | aimath_tensor_elements (const aitensor_t *tensor) |
Calculates the number of elements in a tensor. More... | |
uint32_t | aimath_sizeof_dtype (const aimath_dtype_t *dtype) |
Returns the size of one value in the given data type in bytes. More... | |
uint32_t | aimath_sizeof_tensor_data (const aitensor_t *tensor) |
Returns size of the data array of the tensor in bytes. More... | |
uint32_t | aimath_sizeof_tensor_params (const aitensor_t *tensor) |
Returns size of the aitensor.tensor_params for the data type of the tensor. More... | |
uint32_t | aimath_sizeof_tensor (const aitensor_t *tensor) |
Returns size of tensor in bytes. More... | |
Basic data-type independent math operations.
uint32_t aimath_sizeof_dtype | ( | const aimath_dtype_t * | dtype | ) |
Returns the size of one value in the given data type in bytes.
*dtype | The data type to get the size of |
uint32_t aimath_sizeof_tensor | ( | const aitensor_t * | tensor | ) |
Returns size of tensor in bytes.
The size is calculated by:
*tensor | The tensor to get the size of |
uint32_t aimath_sizeof_tensor_data | ( | const aitensor_t * | tensor | ) |
Returns size of the data array of the tensor in bytes.
The size is calculated by:
*tensor | The tensor to get the data size of |
uint32_t aimath_sizeof_tensor_params | ( | const aitensor_t * | tensor | ) |
Returns size of the aitensor.tensor_params for the data type of the tensor.
*tensor | The tensor to get the parameters size of |
uint32_t aimath_tensor_elements | ( | const aitensor_t * | tensor | ) |
Calculates the number of elements in a tensor.
*tensor | The tensor to count the elements of |
void aimath_transpose_vector | ( | aitensor_t * | vector | ) |
Transposes a vector.
\[ vector \leftarrow vector^T \]
Make sure that the given tensor is a vector (with shape [1 x N] or [N x 1])
*vector | The vector to transpose (2D tensor of shape [1 x N] or [N x 1]) |
void print_aiscalar | ( | const void * | scalar, |
const aimath_dtype_t * | dtype | ||
) |
Printing a scalar to console.
Calls the corresponding print function of the used aimath_dtype.
Example:
*scalar | The scalar to print. |
*dtype | The data type of the scalar |
void print_aitensor | ( | const aitensor_t * | tensor | ) |
Printing a tensor to console.
Calls the corresponding print function of the used aimath_dtype.
Example:
*tensor | The tensor to print. |