File ITensor.h

Parent directory (DlSystem)

Definition (DlSystem/ITensor.h)

Includes

Full File Listing

Typedefs

typedef void *Snpe_ITensor_Handle_t

Represents a tensor which holds n-dimensional data. It is important to understand how the tensor data is represented in memory relative to the tensor dimensions. Tensors store data in memory in row-major order (i.e. the last tensor dimension is the fastest varying one). For example, if you have a two dimensional tensor with 3 rows and 2 columns (i.e. the tensor dimensions are 3,2 as returned in tensor dimension vectors) with the following data in terms rows and columns:

| 1 2 |

| 3 4 |

| 5 6 |

This data would be stored in memory as 1,2,3,4,5,6.

Functions

Snpe_ErrorCode_t Snpe_ITensor_Delete(Snpe_ITensor_Handle_t iTensorHandle)

Destroys/frees an ITensor

Parameters

userBufferHandle[in] : Handle to access the IUserBuffer

Returns

SNPE_SUCCESS if Delete operation successful.

void *Snpe_ITensor_GetData(Snpe_ITensor_Handle_t tensorHandle)

Returns a tensor iterator pointing to the beginning of the data in the tensor.

Parameters

tensorHandle[in] : Handle to access ITensor

Returns

The tensor data as a void pointer.

Snpe_TensorShape_Handle_t Snpe_ITensor_GetShape(Snpe_ITensor_Handle_t tensorHandle)

Gets the shape of this tensor.

The last element of the vector represents the fastest varying dimension and the zeroth element represents the slowest varying dimension, etc.

Parameters

tensorHandle[in] : Handle to access ITensor

Returns

A TensorShape handle holding the tensor dimensions.

size_t Snpe_ITensor_GetSize(Snpe_ITensor_Handle_t tensorHandle)

Returns the element size of the data in the tensor (discounting strides). This is how big a buffer would need to be to hold the tensor data contiguously in memory.

Parameters

tensorHandle[in] : Handle to access ITensor

Returns

The size of the tensor (in elements).

int Snpe_ITensor_IsQuantized(Snpe_ITensor_Handle_t tensorHandle)
float Snpe_ITensor_GetDelta(Snpe_ITensor_Handle_t tensorHandle)
float Snpe_ITensor_GetOffset(Snpe_ITensor_Handle_t tensorHandle)