Skip to content

morapi_Tensor Struct Reference

dnn » tensor

Tensor.
More...

#include <morapi_softneuro.h>

Public Member Functions


Tensor functions

const morapi_Char morapi_Tensor_getName (const morapi_Tensor *self)
morapi_Result  morapi_Tensor_format (morapi_Tensor *self, morapi_DType i_dtype, morapi_Int32 i_rank, const morapi_Int32 *i_shape)
morapi_DType  morapi_Tensor_getDType (const morapi_Tensor *self)
morapi_Int32  morapi_Tensor_getRank (const morapi_Tensor *self)
const morapi_Int32 morapi_Tensor_getShape (const morapi_Tensor *self)
morapi_Int32  morapi_Tensor_getNumAt (const morapi_Tensor *self, morapi_Int32 i_dim)
morapi_Size  morapi_Tensor_getNum (const morapi_Tensor *self)
morapi_Size  morapi_Tensor_getSize (const morapi_Tensor *self)

Tensor operations

morapi_Result  morapi_Tensor_cast (morapi_Tensor *self, morapi_DType i_dtype, const morapi_Tensor *i_src)
morapi_Result  morapi_Tensor_normalize (morapi_Tensor *self, morapi_Bool *o_is_normalized)

Device Buffer

morapi_DeviceBuf morapi_Tensor_findDeviceBuf (const morapi_Tensor *self, const morapi_Device *i_device)
morapi_Result  morapi_Tensor_allocCpuBuf (morapi_Tensor *self)
morapi_Result  morapi_Tensor_deallocCpuBuf (morapi_Tensor *self)
morapi_Result  morapi_Tensor_syncTo (morapi_Tensor *self, const morapi_Device *i_dst_device)
morapi_Result  morapi_Tensor_syncFrom (morapi_Tensor *self, const morapi_Device *i_src_device)

Generic getters

void *  morapi_Tensor_get (const morapi_Tensor *self)
void *  morapi_Tensor_get1 (morapi_Tensor *self, morapi_Int32 i_0)
void *  morapi_Tensor_get2 (morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1)
void *  morapi_Tensor_get3 (morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2)
void *  morapi_Tensor_get4 (morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3)
void *  morapi_Tensor_get5 (morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4)
void *  morapi_Tensor_get6 (morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5)
void *  morapi_Tensor_get7 (morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6)
void *  morapi_Tensor_get8 (morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6, morapi_Int32 i_7)

Float16 getters

morapi_Float16 morapi_Tensor_getFloat16 (const morapi_Tensor *self)
morapi_Float16 morapi_Tensor_get1Float16 (const morapi_Tensor *self, morapi_Int32 i_0)
morapi_Float16 morapi_Tensor_get2Float16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1)
morapi_Float16 morapi_Tensor_get3Float16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2)
morapi_Float16 morapi_Tensor_get4Float16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3)
morapi_Float16 morapi_Tensor_get5Float16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4)
morapi_Float16 morapi_Tensor_get6Float16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5)
morapi_Float16 morapi_Tensor_get7Float16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6)
morapi_Float16 morapi_Tensor_get8Float16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6, morapi_Int32 i_7)

Float32 getters

morapi_Float32 morapi_Tensor_getFloat32 (const morapi_Tensor *self)
morapi_Float32 morapi_Tensor_get1Float32 (const morapi_Tensor *self, morapi_Int32 i_0)
morapi_Float32 morapi_Tensor_get2Float32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1)
morapi_Float32 morapi_Tensor_get3Float32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2)
morapi_Float32 morapi_Tensor_get4Float32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3)
morapi_Float32 morapi_Tensor_get5Float32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4)
morapi_Float32 morapi_Tensor_get6Float32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5)
morapi_Float32 morapi_Tensor_get7Float32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6)
morapi_Float32 morapi_Tensor_get8Float32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6, morapi_Int32 i_7)

Float64 getters

morapi_Float64 morapi_Tensor_getFloat64 (const morapi_Tensor *self)
morapi_Float64 morapi_Tensor_get1Float64 (const morapi_Tensor *self, morapi_Int32 i_0)
morapi_Float64 morapi_Tensor_get2Float64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1)
morapi_Float64 morapi_Tensor_get3Float64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2)
morapi_Float64 morapi_Tensor_get4Float64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3)
morapi_Float64 morapi_Tensor_get5Float64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4)
morapi_Float64 morapi_Tensor_get6Float64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5)
morapi_Float64 morapi_Tensor_get7Float64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6)
morapi_Float64 morapi_Tensor_get8Float64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6, morapi_Int32 i_7)

Uint8 getters

morapi_Uint8 morapi_Tensor_getUint8 (const morapi_Tensor *self)
morapi_Uint8 morapi_Tensor_get1Uint8 (const morapi_Tensor *self, morapi_Int32 i_0)
morapi_Uint8 morapi_Tensor_get2Uint8 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1)
morapi_Uint8 morapi_Tensor_get3Uint8 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2)
morapi_Uint8 morapi_Tensor_get4Uint8 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3)
morapi_Uint8 morapi_Tensor_get5Uint8 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4)
morapi_Uint8 morapi_Tensor_get6Uint8 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5)
morapi_Uint8 morapi_Tensor_get7Uint8 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6)
morapi_Uint8 morapi_Tensor_get8Uint8 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6, morapi_Int32 i_7)

Uint16 getters

morapi_Uint16 morapi_Tensor_getUint16 (const morapi_Tensor *self)
morapi_Uint16 morapi_Tensor_get1Uint16 (const morapi_Tensor *self, morapi_Int32 i_0)
morapi_Uint16 morapi_Tensor_get2Uint16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1)
morapi_Uint16 morapi_Tensor_get3Uint16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2)
morapi_Uint16 morapi_Tensor_get4Uint16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3)
morapi_Uint16 morapi_Tensor_get5Uint16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4)
morapi_Uint16 morapi_Tensor_get6Uint16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5)
morapi_Uint16 morapi_Tensor_get7Uint16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6)
morapi_Uint16 morapi_Tensor_get8Uint16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6, morapi_Int32 i_7)

Uint32 getters

morapi_Uint32 morapi_Tensor_getUint32 (const morapi_Tensor *self)
morapi_Uint32 morapi_Tensor_get1Uint32 (const morapi_Tensor *self, morapi_Int32 i_0)
morapi_Uint32 morapi_Tensor_get2Uint32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1)
morapi_Uint32 morapi_Tensor_get3Uint32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2)
morapi_Uint32 morapi_Tensor_get4Uint32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3)
morapi_Uint32 morapi_Tensor_get5Uint32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4)
morapi_Uint32 morapi_Tensor_get6Uint32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5)
morapi_Uint32 morapi_Tensor_get7Uint32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6)
morapi_Uint32 morapi_Tensor_get8Uint32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6, morapi_Int32 i_7)

Uint64 getters

morapi_Uint64 morapi_Tensor_getUint64 (const morapi_Tensor *self)
morapi_Uint64 morapi_Tensor_get1Uint64 (const morapi_Tensor *self, morapi_Int32 i_0)
morapi_Uint64 morapi_Tensor_get2Uint64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1)
morapi_Uint64 morapi_Tensor_get3Uint64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2)
morapi_Uint64 morapi_Tensor_get4Uint64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3)
morapi_Uint64 morapi_Tensor_get5Uint64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4)
morapi_Uint64 morapi_Tensor_get6Uint64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5)
morapi_Uint64 morapi_Tensor_get7Uint64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6)
morapi_Uint64 morapi_Tensor_get8Uint64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6, morapi_Int32 i_7)

Int8 getters

morapi_Int8 morapi_Tensor_getInt8 (const morapi_Tensor *self)
morapi_Int8 morapi_Tensor_get1Int8 (const morapi_Tensor *self, morapi_Int32 i_0)
morapi_Int8 morapi_Tensor_get2Int8 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1)
morapi_Int8 morapi_Tensor_get3Int8 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2)
morapi_Int8 morapi_Tensor_get4Int8 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3)
morapi_Int8 morapi_Tensor_get5Int8 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4)
morapi_Int8 morapi_Tensor_get6Int8 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5)
morapi_Int8 morapi_Tensor_get7Int8 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6)
morapi_Int8 morapi_Tensor_get8Int8 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6, morapi_Int32 i_7)

Int16 getters

morapi_Int16 morapi_Tensor_getInt16 (const morapi_Tensor *self)
morapi_Int16 morapi_Tensor_get1Int16 (const morapi_Tensor *self, morapi_Int32 i_0)
morapi_Int16 morapi_Tensor_get2Int16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1)
morapi_Int16 morapi_Tensor_get3Int16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2)
morapi_Int16 morapi_Tensor_get4Int16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3)
morapi_Int16 morapi_Tensor_get5Int16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4)
morapi_Int16 morapi_Tensor_get6Int16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5)
morapi_Int16 morapi_Tensor_get7Int16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6)
morapi_Int16 morapi_Tensor_get8Int16 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6, morapi_Int32 i_7)
morapi_Int32 morapi_Tensor_getInt32 (const morapi_Tensor *self)

Int32 getters

morapi_Int32 morapi_Tensor_get1Int32 (const morapi_Tensor *self, morapi_Int32 i_0)
morapi_Int32 morapi_Tensor_get2Int32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1)
morapi_Int32 morapi_Tensor_get3Int32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2)
morapi_Int32 morapi_Tensor_get4Int32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3)
morapi_Int32 morapi_Tensor_get5Int32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4)
morapi_Int32 morapi_Tensor_get6Int32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5)
morapi_Int32 morapi_Tensor_get7Int32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6)
morapi_Int32 morapi_Tensor_get8Int32 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6, morapi_Int32 i_7)

Int64 getters

morapi_Int64 morapi_Tensor_getInt64 (const morapi_Tensor *self)
morapi_Int64 morapi_Tensor_get1Int64 (const morapi_Tensor *self, morapi_Int32 i_0)
morapi_Int64 morapi_Tensor_get2Int64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1)
morapi_Int64 morapi_Tensor_get3Int64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2)
morapi_Int64 morapi_Tensor_get4Int64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3)
morapi_Int64 morapi_Tensor_get5Int64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4)
morapi_Int64 morapi_Tensor_get6Int64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5)
morapi_Int64 morapi_Tensor_get7Int64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6)
morapi_Int64 morapi_Tensor_get8Int64 (const morapi_Tensor *self, morapi_Int32 i_0, morapi_Int32 i_1, morapi_Int32 i_2, morapi_Int32 i_3, morapi_Int32 i_4, morapi_Int32 i_5, morapi_Int32 i_6, morapi_Int32 i_7)

Serialization

morapi_Result  morapi_Tensor_saveNumpy (const morapi_Tensor *self, const morapi_Char *i_filename)
morapi_Result  morapi_Tensor_loadNumpy (morapi_Tensor *self, const morapi_Char *i_filename)

Quantization

morapi_Result  morapi_Tensor_clearMinv (morapi_Tensor *self)
morapi_Result  morapi_Tensor_clearMaxv (morapi_Tensor *self)
morapi_Result  morapi_Tensor_setMinv (morapi_Tensor *self, morapi_Float32 i_minv)
morapi_Result  morapi_Tensor_setMaxv (morapi_Tensor *self, morapi_Float32 i_maxv)
morapi_Bool  morapi_Tensor_hasMinv (const morapi_Tensor *self)
morapi_Bool  morapi_Tensor_hasMaxv (const morapi_Tensor *self)
morapi_Float32  morapi_Tensor_getMinv (const morapi_Tensor *self)
morapi_Float32  morapi_Tensor_getMaxv (const morapi_Tensor *self)
morapi_Bool  morapi_Tensor_isFinite (const morapi_Tensor *self)
morapi_Bool  morapi_Tensor_hasRange (const morapi_Tensor *self)
morapi_Result  morapi_Tensor_initQuant (morapi_Tensor *self, morapi_QMode i_qmode, morapi_Int32 i_qaxis)
morapi_QMode  morapi_Tensor_getQMode (const morapi_Tensor *self)
morapi_Int32  morapi_Tensor_getQAxis (const morapi_Tensor *self)
morapi_Result  morapi_Tensor_calcQuant (morapi_Tensor *self, const morapi_Tensor *i_src)
morapi_Result  morapi_Tensor_calcQuantFromMinvMaxv (morapi_Tensor *self)
morapi_Result  morapi_Tensor_copyQuant (morapi_Tensor *self, const morapi_Tensor *i_src)
morapi_Int32  morapi_Tensor_getQuantNum (const morapi_Tensor *self)
morapi_Quant morapi_Tensor_getQuants (morapi_Tensor *self)
morapi_Quant morapi_Tensor_getQuant (const morapi_Tensor *self, morapi_Int32 i_index)


Detailed Description

Tensor.


test_dnn_api.c.


Member Function Documentation


morapi_Tensor_getName()

const morapi_Char * morapi_Tensor_getName (const morapi_Tensor * self)

Gets the name.

Parameters

  • self : tensor object


morapi_Tensor_format()

morapi_Result morapi_Tensor_format (morapi_Tensor * self,
                                    morapi_DType i_dtype,
                                    morapi_Int32 i_rank,
                                    const morapi_Int32 * i_shape)

Initializes and allocates the CPU buffer.

Parameters

  • self : the tensor
  • i_dtype : data type.
  • i_rank : rank.
  • i_shape : shape ( integer array).


morapi_Tensor_getDType()

morapi_DType morapi_Tensor_getDType (const morapi_Tensor * self)

Gets the data type.

Parameters

  • self : tensor object


morapi_Tensor_getRank()

morapi_Int32 morapi_Tensor_getRank (const morapi_Tensor * self)

Gets the rank (the number of dimensions).

Parameters

  • self : tensor object


morapi_Tensor_getShape()

const morapi_Int32 * morapi_Tensor_getShape (const morapi_Tensor * self)

Gets the shape.

Parameters

  • self : tensor object


morapi_Tensor_getNumAt()

morapi_Int32 morapi_Tensor_getNumAt (const morapi_Tensor * self,
                                     morapi_Int32 i_dim)

Gets the number of elements in the i_dim-th dimension.

Parameters

  • self : tensor object
  • i_dim : dimension index


morapi_Tensor_getNum()

morapi_Size morapi_Tensor_getNum (const morapi_Tensor * self)

Gets the number of elements.

Parameters

  • self : tensor object

test_dnn_api.c.


morapi_Tensor_getSize()

morapi_Size morapi_Tensor_getSize (const morapi_Tensor * self)

Gets the data size.

Parameters

  • self : tensor object


morapi_Tensor_cast()

morapi_Result morapi_Tensor_cast (morapi_Tensor * self,
                                  morapi_DType i_dtype,
                                  const morapi_Tensor * i_src)

Cast & copy the tensor.


morapi_Tensor_findDeviceBuf()

morapi_DeviceBuf * morapi_Tensor_findDeviceBuf (const morapi_Tensor * self,
                                                const morapi_Device * i_device)

Finds the device buffer.

Parameters

  • self : tensor object
  • i_device : device buffer


morapi_Tensor_allocCpuBuf()

morapi_Result morapi_Tensor_allocCpuBuf (morapi_Tensor * self)

Adds and allocates the cpu device buffers.

Parameters

  • self : tensor object


morapi_Tensor_deallocCpuBuf()

morapi_Result morapi_Tensor_deallocCpuBuf (morapi_Tensor * self)

Deallocates the cpu device buffers.

Parameters

  • self : tensor object


morapi_Tensor_syncTo()

morapi_Result morapi_Tensor_syncTo (morapi_Tensor * self,
                                    const morapi_Device * i_dst_device)

Synchronizes the data from cpu to i_dst_device.

Parameters

  • self : tensor object
  • i_dst_device : destination device


morapi_Tensor_syncFrom()

morapi_Result morapi_Tensor_syncFrom (morapi_Tensor * self,
                                      const morapi_Device * i_src_device)

Synchronizes the data from i_src_device to all device buffers.

If NULL == i_src, it syncs from cpu.

Parameters

  • self : tensor object
  • i_src_device : source device


morapi_Tensor_normalize()

morapi_Result morapi_Tensor_normalize (morapi_Tensor * self,
                                       morapi_Bool * o_is_normalized)

Normalize the values.


morapi_Tensor_get()

void * morapi_Tensor_get (const morapi_Tensor * self)

Gets the head pointer of the CPU buffer.

Parameters

  • self : the tensor


morapi_Tensor_get1()

void * morapi_Tensor_get1 (morapi_Tensor * self,
                           morapi_Int32 i_0)

Gets the 1D data pointer.

Parameters

  • self : the tensor
  • i_0 : index for the first dimension


morapi_Tensor_get2()

void * morapi_Tensor_get2 (morapi_Tensor * self,
                           morapi_Int32 i_0,
                           morapi_Int32 i_1)

Gets the 2D data pointer.

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension


morapi_Tensor_get3()

void * morapi_Tensor_get3 (morapi_Tensor * self,
                           morapi_Int32 i_0,
                           morapi_Int32 i_1,
                           morapi_Int32 i_2)

Gets the 3D data pointer.

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension


morapi_Tensor_get4()

void * morapi_Tensor_get4 (morapi_Tensor * self,
                           morapi_Int32 i_0,
                           morapi_Int32 i_1,
                           morapi_Int32 i_2,
                           morapi_Int32 i_3)

Gets the 4D data pointer.

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension


morapi_Tensor_get5()

void * morapi_Tensor_get5 (morapi_Tensor * self,
                           morapi_Int32 i_0,
                           morapi_Int32 i_1,
                           morapi_Int32 i_2,
                           morapi_Int32 i_3,
                           morapi_Int32 i_4)

Gets the 5D data pointer.

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension


morapi_Tensor_get6()

void * morapi_Tensor_get6 (morapi_Tensor * self,
                           morapi_Int32 i_0,
                           morapi_Int32 i_1,
                           morapi_Int32 i_2,
                           morapi_Int32 i_3,
                           morapi_Int32 i_4,
                           morapi_Int32 i_5)

Gets the 6D data pointer.

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension


morapi_Tensor_get7()

void * morapi_Tensor_get7 (morapi_Tensor * self,
                           morapi_Int32 i_0,
                           morapi_Int32 i_1,
                           morapi_Int32 i_2,
                           morapi_Int32 i_3,
                           morapi_Int32 i_4,
                           morapi_Int32 i_5,
                           morapi_Int32 i_6)

Gets the 7D data pointer.

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension


morapi_Tensor_get8()

void * morapi_Tensor_get8 (morapi_Tensor * self,
                           morapi_Int32 i_0,
                           morapi_Int32 i_1,
                           morapi_Int32 i_2,
                           morapi_Int32 i_3,
                           morapi_Int32 i_4,
                           morapi_Int32 i_5,
                           morapi_Int32 i_6,
                           morapi_Int32 i_7)

Gets the 8D data pointer.

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension
  • i_7 : index for the eigth dimension


morapi_Tensor_getFloat16()

morapi_Float16 * morapi_Tensor_getFloat16 (const morapi_Tensor * self)

Gets the head of data pointer (morapi_Float16).

Parameters

  • self : the tensor


morapi_Tensor_get1Float16()

morapi_Float16 * morapi_Tensor_get1Float16 (const morapi_Tensor * self,
                                            morapi_Int32 i_0)

Gets the 1D data pointer (morapi_Float16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension


morapi_Tensor_get2Float16()

morapi_Float16 * morapi_Tensor_get2Float16 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1)

Gets the 2D data pointer (morapi_Float16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension


morapi_Tensor_get3Float16()

morapi_Float16 * morapi_Tensor_get3Float16 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1,
                                            morapi_Int32 i_2)

Gets the 3D data pointer (morapi_Float16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension


morapi_Tensor_get4Float16()

morapi_Float16 * morapi_Tensor_get4Float16 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1,
                                            morapi_Int32 i_2,
                                            morapi_Int32 i_3)

Gets the 4D data pointer (morapi_Float16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension


morapi_Tensor_get5Float16()

morapi_Float16 * morapi_Tensor_get5Float16 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1,
                                            morapi_Int32 i_2,
                                            morapi_Int32 i_3,
                                            morapi_Int32 i_4)

Gets the 5D data pointer (morapi_Float16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension


morapi_Tensor_get6Float16()

morapi_Float16 * morapi_Tensor_get6Float16 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1,
                                            morapi_Int32 i_2,
                                            morapi_Int32 i_3,
                                            morapi_Int32 i_4,
                                            morapi_Int32 i_5)

Gets the 6D data pointer (morapi_Float16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension


morapi_Tensor_get7Float16()

morapi_Float16 * morapi_Tensor_get7Float16 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1,
                                            morapi_Int32 i_2,
                                            morapi_Int32 i_3,
                                            morapi_Int32 i_4,
                                            morapi_Int32 i_5,
                                            morapi_Int32 i_6)

Gets the 7D data pointer (morapi_Float16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension


morapi_Tensor_get8Float16()

morapi_Float16 * morapi_Tensor_get8Float16 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1,
                                            morapi_Int32 i_2,
                                            morapi_Int32 i_3,
                                            morapi_Int32 i_4,
                                            morapi_Int32 i_5,
                                            morapi_Int32 i_6,
                                            morapi_Int32 i_7)

Gets the 8D data pointer (morapi_Float16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension
  • i_7 : index for the eigth dimension


morapi_Tensor_getFloat32()

morapi_Float32 * morapi_Tensor_getFloat32 (const morapi_Tensor * self)

Gets the head of data pointer (morapi_Float32).

Parameters

  • self : the tensor

test_dnn_api.c.


morapi_Tensor_get1Float32()

morapi_Float32 * morapi_Tensor_get1Float32 (const morapi_Tensor * self,
                                            morapi_Int32 i_0)

Gets the 1D data pointer (morapi_Float32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension


morapi_Tensor_get2Float32()

morapi_Float32 * morapi_Tensor_get2Float32 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1)

Gets the 2D data pointer (morapi_Float32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension


morapi_Tensor_get3Float32()

morapi_Float32 * morapi_Tensor_get3Float32 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1,
                                            morapi_Int32 i_2)

Gets the 3D data pointer (morapi_Float32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension


morapi_Tensor_get4Float32()

morapi_Float32 * morapi_Tensor_get4Float32 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1,
                                            morapi_Int32 i_2,
                                            morapi_Int32 i_3)

Gets the 4D data pointer (morapi_Float32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension


morapi_Tensor_get5Float32()

morapi_Float32 * morapi_Tensor_get5Float32 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1,
                                            morapi_Int32 i_2,
                                            morapi_Int32 i_3,
                                            morapi_Int32 i_4)

Gets the 5D data pointer (morapi_Float32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension


morapi_Tensor_get6Float32()

morapi_Float32 * morapi_Tensor_get6Float32 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1,
                                            morapi_Int32 i_2,
                                            morapi_Int32 i_3,
                                            morapi_Int32 i_4,
                                            morapi_Int32 i_5)

Gets the 6D data pointer (morapi_Float32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension


morapi_Tensor_get7Float32()

morapi_Float32 * morapi_Tensor_get7Float32 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1,
                                            morapi_Int32 i_2,
                                            morapi_Int32 i_3,
                                            morapi_Int32 i_4,
                                            morapi_Int32 i_5,
                                            morapi_Int32 i_6)

Gets the 7D data pointer (morapi_Float32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension


morapi_Tensor_get8Float32()

morapi_Float32 * morapi_Tensor_get8Float32 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1,
                                            morapi_Int32 i_2,
                                            morapi_Int32 i_3,
                                            morapi_Int32 i_4,
                                            morapi_Int32 i_5,
                                            morapi_Int32 i_6,
                                            morapi_Int32 i_7)

Gets the 8D data pointer (morapi_Float32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension
  • i_7 : index for the eigth dimension


morapi_Tensor_getFloat64()

morapi_Float64 * morapi_Tensor_getFloat64 (const morapi_Tensor * self)

Gets the head of data pointer (morapi_Float64).

Parameters

  • self : the tensor


morapi_Tensor_get1Float64()

morapi_Float64 * morapi_Tensor_get1Float64 (const morapi_Tensor * self,
                                            morapi_Int32 i_0)

Gets the 1D data pointer.

Parameters

  • self : the tensor
  • i_0 : index for the first dimension


morapi_Tensor_get2Float64()

morapi_Float64 * morapi_Tensor_get2Float64 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1)

Gets the 2D data pointer (morapi_Float64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension


morapi_Tensor_get3Float64()

morapi_Float64 * morapi_Tensor_get3Float64 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1,
                                            morapi_Int32 i_2)

Gets the 3D data pointer (morapi_Float64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension


morapi_Tensor_get4Float64()

morapi_Float64 * morapi_Tensor_get4Float64 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1,
                                            morapi_Int32 i_2,
                                            morapi_Int32 i_3)

Gets the 4D data pointer (morapi_Float64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension


morapi_Tensor_get5Float64()

morapi_Float64 * morapi_Tensor_get5Float64 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1,
                                            morapi_Int32 i_2,
                                            morapi_Int32 i_3,
                                            morapi_Int32 i_4)

Gets the 5D data pointer (morapi_Float64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension


morapi_Tensor_get6Float64()

morapi_Float64 * morapi_Tensor_get6Float64 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1,
                                            morapi_Int32 i_2,
                                            morapi_Int32 i_3,
                                            morapi_Int32 i_4,
                                            morapi_Int32 i_5)

Gets the 6D data pointer (morapi_Float64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension


morapi_Tensor_get7Float64()

morapi_Float64 * morapi_Tensor_get7Float64 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1,
                                            morapi_Int32 i_2,
                                            morapi_Int32 i_3,
                                            morapi_Int32 i_4,
                                            morapi_Int32 i_5,
                                            morapi_Int32 i_6)

Gets the 7D data pointer (morapi_Float64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension


morapi_Tensor_get8Float64()

morapi_Float64 * morapi_Tensor_get8Float64 (const morapi_Tensor * self,
                                            morapi_Int32 i_0,
                                            morapi_Int32 i_1,
                                            morapi_Int32 i_2,
                                            morapi_Int32 i_3,
                                            morapi_Int32 i_4,
                                            morapi_Int32 i_5,
                                            morapi_Int32 i_6,
                                            morapi_Int32 i_7)

Gets the 8D data pointer (morapi_Float64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension
  • i_7 : index for the eigth dimension


morapi_Tensor_getUint8()

morapi_Uint8 * morapi_Tensor_getUint8 (const morapi_Tensor * self)

Gets the head of data pointer (morapi_Uint8).

Parameters

  • self : the tensor


morapi_Tensor_get1Uint8()

morapi_Uint8 * morapi_Tensor_get1Uint8 (const morapi_Tensor * self,
                                        morapi_Int32 i_0)

Gets the 1D data pointer (morapi_Uint8).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension


morapi_Tensor_get2Uint8()

morapi_Uint8 * morapi_Tensor_get2Uint8 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1)

Gets the 2D data pointer (morapi_Uint8).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension


morapi_Tensor_get3Uint8()

morapi_Uint8 * morapi_Tensor_get3Uint8 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2)

Gets the 3D data pointer (morapi_Uint8).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension


morapi_Tensor_get4Uint8()

morapi_Uint8 * morapi_Tensor_get4Uint8 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2,
                                        morapi_Int32 i_3)

Gets the 4D data pointer (morapi_Uint8).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension


morapi_Tensor_get5Uint8()

morapi_Uint8 * morapi_Tensor_get5Uint8 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2,
                                        morapi_Int32 i_3,
                                        morapi_Int32 i_4)

Gets the 5D data pointer (morapi_Uint8).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension


morapi_Tensor_get6Uint8()

morapi_Uint8 * morapi_Tensor_get6Uint8 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2,
                                        morapi_Int32 i_3,
                                        morapi_Int32 i_4,
                                        morapi_Int32 i_5)

Gets the 6D data pointer (morapi_Uint8).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension


morapi_Tensor_get7Uint8()

morapi_Uint8 * morapi_Tensor_get7Uint8 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2,
                                        morapi_Int32 i_3,
                                        morapi_Int32 i_4,
                                        morapi_Int32 i_5,
                                        morapi_Int32 i_6)

Gets the 7D data pointer (morapi_Uint8).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension


morapi_Tensor_get8Uint8()

morapi_Uint8 * morapi_Tensor_get8Uint8 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2,
                                        morapi_Int32 i_3,
                                        morapi_Int32 i_4,
                                        morapi_Int32 i_5,
                                        morapi_Int32 i_6,
                                        morapi_Int32 i_7)

Gets the 8D data pointer (morapi_Uint8).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension
  • i_7 : index for the eigth dimension


morapi_Tensor_getUint16()

morapi_Uint16 * morapi_Tensor_getUint16 (const morapi_Tensor * self)

Gets the head of data pointer (morapi_Uint16).

Parameters

  • self : the tensor


morapi_Tensor_get1Uint16()

morapi_Uint16 * morapi_Tensor_get1Uint16 (const morapi_Tensor * self,
                                          morapi_Int32 i_0)

Gets the 1D data pointer (morapi_Uint16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension


morapi_Tensor_get2Uint16()

morapi_Uint16 * morapi_Tensor_get2Uint16 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1)

Gets the 2D data pointer (morapi_Uint16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension


morapi_Tensor_get3Uint16()

morapi_Uint16 * morapi_Tensor_get3Uint16 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1,
                                          morapi_Int32 i_2)

Gets the 3D data pointer (morapi_Uint16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension


morapi_Tensor_get4Uint16()

morapi_Uint16 * morapi_Tensor_get4Uint16 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1,
                                          morapi_Int32 i_2,
                                          morapi_Int32 i_3)

Gets the 4D data pointer (morapi_Uint16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension


morapi_Tensor_get5Uint16()

morapi_Uint16 * morapi_Tensor_get5Uint16 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1,
                                          morapi_Int32 i_2,
                                          morapi_Int32 i_3,
                                          morapi_Int32 i_4)

Gets the 5D data pointer (morapi_Uint16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension


morapi_Tensor_get6Uint16()

morapi_Uint16 * morapi_Tensor_get6Uint16 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1,
                                          morapi_Int32 i_2,
                                          morapi_Int32 i_3,
                                          morapi_Int32 i_4,
                                          morapi_Int32 i_5)

Gets the 6D data pointer (morapi_Uint16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension


morapi_Tensor_get7Uint16()

morapi_Uint16 * morapi_Tensor_get7Uint16 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1,
                                          morapi_Int32 i_2,
                                          morapi_Int32 i_3,
                                          morapi_Int32 i_4,
                                          morapi_Int32 i_5,
                                          morapi_Int32 i_6)

Gets the 7D data pointer (morapi_Uint16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension


morapi_Tensor_get8Uint16()

morapi_Uint16 * morapi_Tensor_get8Uint16 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1,
                                          morapi_Int32 i_2,
                                          morapi_Int32 i_3,
                                          morapi_Int32 i_4,
                                          morapi_Int32 i_5,
                                          morapi_Int32 i_6,
                                          morapi_Int32 i_7)

Gets the 8D data pointer (morapi_Uint16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension
  • i_7 : index for the eigth dimension


morapi_Tensor_getUint32()

morapi_Uint32 * morapi_Tensor_getUint32 (const morapi_Tensor * self)

Gets the head of data pointer (morapi_Uint32).

Parameters

  • self : the tensor


morapi_Tensor_get1Uint32()

morapi_Uint32 * morapi_Tensor_get1Uint32 (const morapi_Tensor * self,
                                          morapi_Int32 i_0)

Gets the 1D data pointer (morapi_Uint32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension


morapi_Tensor_get2Uint32()

morapi_Uint32 * morapi_Tensor_get2Uint32 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1)

Gets the 2D data pointer (morapi_Uint32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension


morapi_Tensor_get3Uint32()

morapi_Uint32 * morapi_Tensor_get3Uint32 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1,
                                          morapi_Int32 i_2)

Gets the 3D data pointer (morapi_Uint32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension


morapi_Tensor_get4Uint32()

morapi_Uint32 * morapi_Tensor_get4Uint32 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1,
                                          morapi_Int32 i_2,
                                          morapi_Int32 i_3)

Gets the 4D data pointer (morapi_Uint32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension


morapi_Tensor_get5Uint32()

morapi_Uint32 * morapi_Tensor_get5Uint32 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1,
                                          morapi_Int32 i_2,
                                          morapi_Int32 i_3,
                                          morapi_Int32 i_4)

Gets the 5D data pointer (morapi_Uint32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension


morapi_Tensor_get6Uint32()

morapi_Uint32 * morapi_Tensor_get6Uint32 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1,
                                          morapi_Int32 i_2,
                                          morapi_Int32 i_3,
                                          morapi_Int32 i_4,
                                          morapi_Int32 i_5)

Gets the 6D data pointer (morapi_Uint32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension


morapi_Tensor_get7Uint32()

morapi_Uint32 * morapi_Tensor_get7Uint32 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1,
                                          morapi_Int32 i_2,
                                          morapi_Int32 i_3,
                                          morapi_Int32 i_4,
                                          morapi_Int32 i_5,
                                          morapi_Int32 i_6)

Gets the 7D data pointer (morapi_Uint32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension


morapi_Tensor_get8Uint32()

morapi_Uint32 * morapi_Tensor_get8Uint32 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1,
                                          morapi_Int32 i_2,
                                          morapi_Int32 i_3,
                                          morapi_Int32 i_4,
                                          morapi_Int32 i_5,
                                          morapi_Int32 i_6,
                                          morapi_Int32 i_7)

Gets the 8D data pointer (morapi_Uint32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension
  • i_7 : index for the eigth dimension


morapi_Tensor_getUint64()

morapi_Uint64 * morapi_Tensor_getUint64 (const morapi_Tensor * self)

Gets the head of data pointer (morapi_Uint64).

Parameters

  • self : the tensor


morapi_Tensor_get1Uint64()

morapi_Uint64 * morapi_Tensor_get1Uint64 (const morapi_Tensor * self,
                                          morapi_Int32 i_0)

Gets the 1D data pointer (morapi_Uint64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension


morapi_Tensor_get2Uint64()

morapi_Uint64 * morapi_Tensor_get2Uint64 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1)

Gets the 2D data pointer (morapi_Uint64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension


morapi_Tensor_get3Uint64()

morapi_Uint64 * morapi_Tensor_get3Uint64 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1,
                                          morapi_Int32 i_2)

Gets the 3D data pointer (morapi_Uint64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension


morapi_Tensor_get4Uint64()

morapi_Uint64 * morapi_Tensor_get4Uint64 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1,
                                          morapi_Int32 i_2,
                                          morapi_Int32 i_3)

Gets the 4D data pointer (morapi_Uint64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension


morapi_Tensor_get5Uint64()

morapi_Uint64 * morapi_Tensor_get5Uint64 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1,
                                          morapi_Int32 i_2,
                                          morapi_Int32 i_3,
                                          morapi_Int32 i_4)

Gets the 5D data pointer (morapi_Uint64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension


morapi_Tensor_get6Uint64()

morapi_Uint64 * morapi_Tensor_get6Uint64 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1,
                                          morapi_Int32 i_2,
                                          morapi_Int32 i_3,
                                          morapi_Int32 i_4,
                                          morapi_Int32 i_5)

Gets the 6D data pointer (morapi_Uint64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension


morapi_Tensor_get7Uint64()

morapi_Uint64 * morapi_Tensor_get7Uint64 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1,
                                          morapi_Int32 i_2,
                                          morapi_Int32 i_3,
                                          morapi_Int32 i_4,
                                          morapi_Int32 i_5,
                                          morapi_Int32 i_6)

Gets the 7D data pointer (morapi_Uint64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension


morapi_Tensor_get8Uint64()

morapi_Uint64 * morapi_Tensor_get8Uint64 (const morapi_Tensor * self,
                                          morapi_Int32 i_0,
                                          morapi_Int32 i_1,
                                          morapi_Int32 i_2,
                                          morapi_Int32 i_3,
                                          morapi_Int32 i_4,
                                          morapi_Int32 i_5,
                                          morapi_Int32 i_6,
                                          morapi_Int32 i_7)

Gets the 8D data pointer (morapi_Uint64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension
  • i_7 : index for the eigth dimension


morapi_Tensor_getInt8()

morapi_Int8 * morapi_Tensor_getInt8 (const morapi_Tensor * self)

Gets the head of data pointer (morapi_Int8).

Parameters

  • self : the tensor


morapi_Tensor_get1Int8()

morapi_Int8 * morapi_Tensor_get1Int8 (const morapi_Tensor * self,
                                      morapi_Int32 i_0)

Gets the 1D data pointer (morapi_Int8).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension


morapi_Tensor_get2Int8()

morapi_Int8 * morapi_Tensor_get2Int8 (const morapi_Tensor * self,
                                      morapi_Int32 i_0,
                                      morapi_Int32 i_1)

Gets the 2D data pointer (morapi_Int8).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension


morapi_Tensor_get3Int8()

morapi_Int8 * morapi_Tensor_get3Int8 (const morapi_Tensor * self,
                                      morapi_Int32 i_0,
                                      morapi_Int32 i_1,
                                      morapi_Int32 i_2)

Gets the 3D data pointer (morapi_Int8).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension


morapi_Tensor_get4Int8()

morapi_Int8 * morapi_Tensor_get4Int8 (const morapi_Tensor * self,
                                      morapi_Int32 i_0,
                                      morapi_Int32 i_1,
                                      morapi_Int32 i_2,
                                      morapi_Int32 i_3)

Gets the 4D data pointer (morapi_Int8).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension


morapi_Tensor_get5Int8()

morapi_Int8 * morapi_Tensor_get5Int8 (const morapi_Tensor * self,
                                      morapi_Int32 i_0,
                                      morapi_Int32 i_1,
                                      morapi_Int32 i_2,
                                      morapi_Int32 i_3,
                                      morapi_Int32 i_4)

Gets the 5D data pointer (morapi_Int8).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension


morapi_Tensor_get6Int8()

morapi_Int8 * morapi_Tensor_get6Int8 (const morapi_Tensor * self,
                                      morapi_Int32 i_0,
                                      morapi_Int32 i_1,
                                      morapi_Int32 i_2,
                                      morapi_Int32 i_3,
                                      morapi_Int32 i_4,
                                      morapi_Int32 i_5)

Gets the 6D data pointer (morapi_Int8).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension


morapi_Tensor_get7Int8()

morapi_Int8 * morapi_Tensor_get7Int8 (const morapi_Tensor * self,
                                      morapi_Int32 i_0,
                                      morapi_Int32 i_1,
                                      morapi_Int32 i_2,
                                      morapi_Int32 i_3,
                                      morapi_Int32 i_4,
                                      morapi_Int32 i_5,
                                      morapi_Int32 i_6)

Gets the 7D data pointer (morapi_Int8).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension


morapi_Tensor_get8Int8()

morapi_Int8 * morapi_Tensor_get8Int8 (const morapi_Tensor * self,
                                      morapi_Int32 i_0,
                                      morapi_Int32 i_1,
                                      morapi_Int32 i_2,
                                      morapi_Int32 i_3,
                                      morapi_Int32 i_4,
                                      morapi_Int32 i_5,
                                      morapi_Int32 i_6,
                                      morapi_Int32 i_7)

Gets the 8D data pointer (morapi_Int8).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension
  • i_7 : index for the eigth dimension


morapi_Tensor_getInt16()

morapi_Int16 * morapi_Tensor_getInt16 (const morapi_Tensor * self)

Gets the head of data pointer (morapi_Int16).

Parameters

  • self : the tensor


morapi_Tensor_get1Int16()

morapi_Int16 * morapi_Tensor_get1Int16 (const morapi_Tensor * self,
                                        morapi_Int32 i_0)

Gets the 1D data pointer (morapi_Int16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension


morapi_Tensor_get2Int16()

morapi_Int16 * morapi_Tensor_get2Int16 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1)

Gets the 2D data pointer (morapi_Int16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension


morapi_Tensor_get3Int16()

morapi_Int16 * morapi_Tensor_get3Int16 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2)

Gets the 3D data pointer (morapi_Int16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension


morapi_Tensor_get4Int16()

morapi_Int16 * morapi_Tensor_get4Int16 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2,
                                        morapi_Int32 i_3)

Gets the 4D data pointer (morapi_Int16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension


morapi_Tensor_get5Int16()

morapi_Int16 * morapi_Tensor_get5Int16 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2,
                                        morapi_Int32 i_3,
                                        morapi_Int32 i_4)

Gets the 5D data pointer (morapi_Int16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension


morapi_Tensor_get6Int16()

morapi_Int16 * morapi_Tensor_get6Int16 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2,
                                        morapi_Int32 i_3,
                                        morapi_Int32 i_4,
                                        morapi_Int32 i_5)

Gets the 6D data pointer (morapi_Int16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension


morapi_Tensor_get7Int16()

morapi_Int16 * morapi_Tensor_get7Int16 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2,
                                        morapi_Int32 i_3,
                                        morapi_Int32 i_4,
                                        morapi_Int32 i_5,
                                        morapi_Int32 i_6)

Gets the 7D data pointer (morapi_Int16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension


morapi_Tensor_get8Int16()

morapi_Int16 * morapi_Tensor_get8Int16 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2,
                                        morapi_Int32 i_3,
                                        morapi_Int32 i_4,
                                        morapi_Int32 i_5,
                                        morapi_Int32 i_6,
                                        morapi_Int32 i_7)

Gets the 8D data pointer (morapi_Int16).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension
  • i_7 : index for the eigth dimension


morapi_Tensor_getInt32()

morapi_Int32 * morapi_Tensor_getInt32 (const morapi_Tensor * self)

Gets the head of data pointer (morapi_Int32).

Parameters

  • self : the tensor


morapi_Tensor_get1Int32()

morapi_Int32 * morapi_Tensor_get1Int32 (const morapi_Tensor * self,
                                        morapi_Int32 i_0)

Gets the 1D data pointer (morapi_Int32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension


morapi_Tensor_get2Int32()

morapi_Int32 * morapi_Tensor_get2Int32 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1)

Gets the 2D data pointer (morapi_Int32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension


morapi_Tensor_get3Int32()

morapi_Int32 * morapi_Tensor_get3Int32 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2)

Gets the 3D data pointer (morapi_Int32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension


morapi_Tensor_get4Int32()

morapi_Int32 * morapi_Tensor_get4Int32 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2,
                                        morapi_Int32 i_3)

Gets the 4D data pointer (morapi_Int32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension


morapi_Tensor_get5Int32()

morapi_Int32 * morapi_Tensor_get5Int32 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2,
                                        morapi_Int32 i_3,
                                        morapi_Int32 i_4)

Gets the 5D data pointer (morapi_Int32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension


morapi_Tensor_get6Int32()

morapi_Int32 * morapi_Tensor_get6Int32 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2,
                                        morapi_Int32 i_3,
                                        morapi_Int32 i_4,
                                        morapi_Int32 i_5)

Gets the 6D data pointer (morapi_Int32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension


morapi_Tensor_get7Int32()

morapi_Int32 * morapi_Tensor_get7Int32 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2,
                                        morapi_Int32 i_3,
                                        morapi_Int32 i_4,
                                        morapi_Int32 i_5,
                                        morapi_Int32 i_6)

Gets the 7D data pointer (morapi_Int32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension


morapi_Tensor_get8Int32()

morapi_Int32 * morapi_Tensor_get8Int32 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2,
                                        morapi_Int32 i_3,
                                        morapi_Int32 i_4,
                                        morapi_Int32 i_5,
                                        morapi_Int32 i_6,
                                        morapi_Int32 i_7)

Gets the 8D data pointer (morapi_Int32).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension
  • i_7 : index for the eigth dimension


morapi_Tensor_getInt64()

morapi_Int64 * morapi_Tensor_getInt64 (const morapi_Tensor * self)

Gets the head of data pointer (morapi_Int64).

Parameters

  • self : the tensor


morapi_Tensor_get1Int64()

morapi_Int64 * morapi_Tensor_get1Int64 (const morapi_Tensor * self,
                                        morapi_Int32 i_0)

Gets the 1D data pointer (morapi_Int64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension


morapi_Tensor_get2Int64()

morapi_Int64 * morapi_Tensor_get2Int64 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1)

Gets the 2D data pointer (morapi_Int64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension


morapi_Tensor_get3Int64()

morapi_Int64 * morapi_Tensor_get3Int64 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2)

Gets the 3D data pointer (morapi_Int64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension


morapi_Tensor_get4Int64()

morapi_Int64 * morapi_Tensor_get4Int64 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2,
                                        morapi_Int32 i_3)

Gets the 4D data pointer (morapi_Int64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension


morapi_Tensor_get5Int64()

morapi_Int64 * morapi_Tensor_get5Int64 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2,
                                        morapi_Int32 i_3,
                                        morapi_Int32 i_4)

Gets the 5D data pointer (morapi_Int64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension


morapi_Tensor_get6Int64()

morapi_Int64 * morapi_Tensor_get6Int64 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2,
                                        morapi_Int32 i_3,
                                        morapi_Int32 i_4,
                                        morapi_Int32 i_5)

Gets the 6D data pointer (morapi_Int64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension


morapi_Tensor_get7Int64()

morapi_Int64 * morapi_Tensor_get7Int64 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2,
                                        morapi_Int32 i_3,
                                        morapi_Int32 i_4,
                                        morapi_Int32 i_5,
                                        morapi_Int32 i_6)

Gets the 7D data pointer (morapi_Int64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension


morapi_Tensor_get8Int64()

morapi_Int64 * morapi_Tensor_get8Int64 (const morapi_Tensor * self,
                                        morapi_Int32 i_0,
                                        morapi_Int32 i_1,
                                        morapi_Int32 i_2,
                                        morapi_Int32 i_3,
                                        morapi_Int32 i_4,
                                        morapi_Int32 i_5,
                                        morapi_Int32 i_6,
                                        morapi_Int32 i_7)

Gets the 8D data pointer (morapi_Int64).

Parameters

  • self : the tensor
  • i_0 : index for the first dimension
  • i_1 : index for the second dimension
  • i_2 : index for the third dimension
  • i_3 : index for the fourth dimension
  • i_4 : index for the fifth dimension
  • i_5 : index for the sixth dimension
  • i_6 : index for the seventh dimension
  • i_7 : index for the eigth dimension


morapi_Tensor_saveNumpy()

morapi_Result morapi_Tensor_saveNumpy (const morapi_Tensor * self,
                                       const morapi_Char * i_filename)

Writes the tensor to file with a numpy format.


morapi_Tensor_loadNumpy()

morapi_Result morapi_Tensor_loadNumpy (morapi_Tensor * self,
                                       const morapi_Char * i_filename)

Reads the tensor from file with a numpy format.


morapi_Tensor_clearMinv()

morapi_Result morapi_Tensor_clearMinv (morapi_Tensor * self)

Clears the min value.

Parameters

  • self : the tensor


morapi_Tensor_clearMaxv()

morapi_Result morapi_Tensor_clearMaxv (morapi_Tensor * self)

Clears the max value.

Parameters

  • self : the tensor


morapi_Tensor_setMinv()

morapi_Result morapi_Tensor_setMinv (morapi_Tensor * self,
                                     morapi_Float32 i_minv)

Set the min value.

Parameters

  • self : the tensor
  • i_minv : minimum value


morapi_Tensor_setMaxv()

morapi_Result morapi_Tensor_setMaxv (morapi_Tensor * self,
                                     morapi_Float32 i_maxv)

Set the max value.

Parameters

  • self : the tensor
  • i_maxv : maximum value


morapi_Tensor_hasMinv()

morapi_Bool morapi_Tensor_hasMinv (const morapi_Tensor * self)

Whether self has the min value or not.

Parameters

  • self : the tensor


morapi_Tensor_hasMaxv()

morapi_Bool morapi_Tensor_hasMaxv (const morapi_Tensor * self)

Whether self has the max value or not.

Parameters

  • self : the tensor


morapi_Tensor_getMinv()

morapi_Float32 morapi_Tensor_getMinv (const morapi_Tensor * self)

Get the min value.

Parameters

  • self : the tensor


morapi_Tensor_getMaxv()

morapi_Float32 morapi_Tensor_getMaxv (const morapi_Tensor * self)

Get the max value.

Parameters

  • self : the tensor


morapi_Tensor_isFinite()

morapi_Bool morapi_Tensor_isFinite (const morapi_Tensor * self)

Whether self has the min value and the max value.

Parameters

  • self : the tensor


morapi_Tensor_hasRange()

morapi_Bool morapi_Tensor_hasRange (const morapi_Tensor * self)

Whether self has a range (the min and max values).

Parameters

  • self : the tensor


morapi_Tensor_initQuant()

morapi_Result morapi_Tensor_initQuant (morapi_Tensor * self,
                                       morapi_QMode i_qmode,
                                       morapi_Int32 i_qaxis)

Initialize the quantizers with i_qmode.

If the dtype isn't QINT8 or QINT32, it returns MORAPI_ERROR_STATE.

Parameters

  • self : the tensor
  • i_qmode : quantization mode
  • i_qaxis : quantization axis. It may be that 0 <= i_qaxis even when per-tensor mode for dithering.


morapi_Tensor_getQMode()

morapi_QMode morapi_Tensor_getQMode (const morapi_Tensor * self)

Gets the quantization type.


morapi_Tensor_getQAxis()

morapi_Int32 morapi_Tensor_getQAxis (const morapi_Tensor * self)

Gets the quantization axis.

Parameters

  • self : the tensor


morapi_Tensor_calcQuant()

morapi_Result morapi_Tensor_calcQuant (morapi_Tensor * self,
                                       const morapi_Tensor * i_src)

Calculates quants from i_src.

The data type of i_src must be float32 or qint32.


morapi_Tensor_calcQuantFromMinvMaxv()

morapi_Result morapi_Tensor_calcQuantFromMinvMaxv (morapi_Tensor * self)

Calculates quants from the min and max values.


morapi_Tensor_copyQuant()

morapi_Result morapi_Tensor_copyQuant (morapi_Tensor * self,
                                       const morapi_Tensor * i_src)

Copies the quantization parameters.

That is, minv, maxv and quantization coefficients.


morapi_Tensor_getQuantNum()

morapi_Int32 morapi_Tensor_getQuantNum (const morapi_Tensor * self)

Gets the number of quants.

Parameters

  • self : the tensor


morapi_Tensor_getQuants()

morapi_Quant * morapi_Tensor_getQuants (morapi_Tensor * self)

Gets the quants.

Parameters

  • self : the tensor


morapi_Tensor_getQuant()

morapi_Quant * morapi_Tensor_getQuant (const morapi_Tensor * self,
                                       morapi_Int32 i_index)

Gets the i_index-th quant.

Parameters

  • self : the tensor
  • i_index : quant index