File TensorShape.h

Parent directory (DlSystem)

Definition (DlSystem/TensorShape.h)

Includes

Full File Listing

Typedefs

typedef void *Snpe_TensorShape_Handle_t

A typedef to indicate a SNPE TensorShape handle

Functions

Snpe_TensorShape_Handle_t Snpe_TensorShape_CreateDimsSize(const size_t *dims, size_t size)

Creates a new shape with a list of dims specified in array

Parameters
  • dims[in] The dimensions are specified in which the last element of the vector represents the fastest varying dimension and the zeroth element represents the slowest varying, etc.

  • size[in] Size of the array.

Returns

the handle to the created TensorShape

Snpe_TensorShape_Handle_t Snpe_TensorShape_Create()

Constructs a TensorShape and returns a handle to it

Returns

the handle to the created TensorShape

Snpe_TensorShape_Handle_t Snpe_TensorShape_CreateCopy(Snpe_TensorShape_Handle_t other)

copy constructor.

Parameters

other[in] object to copy.

Returns

the handle to the created TensorShape.

Snpe_ErrorCode_t Snpe_TensorShape_Delete(Snpe_TensorShape_Handle_t tensorShapeHandle)

Destroys/frees Tensor Shape

Parameters

handle[in] : handle to tensorShape

Returns

SNPE_SUCCESS if Delete operation successful.

Snpe_ErrorCode_t Snpe_TensorShape_Assign(Snpe_TensorShape_Handle_t srcHandle, Snpe_TensorShape_Handle_t dstHandle)

Copy-assigns the contents of srcHandle into dstHandle

Parameters
  • srcHandle – Source TensorShape handle

  • dstHandle – Destination TensorShape handle

Returns

SNPE_SUCCESS on successful copy-assignment

void Snpe_TensorShape_Concatenate(Snpe_TensorShape_Handle_t tensorShape, const size_t *dims, size_t size)

Concatenates additional dimensions specified in the array to the existing dimensions.

Parameters
  • handle[in] : handle to tensorShape

  • dims[in] The dimensions are specified in which the last element of the vector represents the fastest varying dimension and the zeroth element represents the slowest varying, etc.

  • size[in] Size of the array.

size_t Snpe_TensorShape_Rank(Snpe_TensorShape_Handle_t tensorShape)

Retrieves the rank i.e. number of dimensions.

Parameters

handle[in] : handle to tensorShape

Returns

The rank

size_t Snpe_TensorShape_At(Snpe_TensorShape_Handle_t tensorShapeHandle, size_t index)
Parameters
  • handle[in] : handle to tensorShape

  • index[in] : Position in the dimension array.

Returns

The dimension value in tensor shape

Snpe_ErrorCode_t Snpe_TensorShape_Set(Snpe_TensorShape_Handle_t tensorShapeHandle, size_t index, size_t value)

Set a value in a TensorShape at the provided index.

Parameters
  • handle[in] : handle to tensorShape

  • index[in] : Position in the dimension array.

  • value[in] : Dimension value to set

Returns

SNPE_SUCCESS on success

const size_t *Snpe_TensorShape_GetDimensions(Snpe_TensorShape_Handle_t tensorShape)

Retrieves a pointer to the first dimension of shape

Parameters

handle[in] : handle to tensorShape

Returns

nullptr if no dimension exists; otherwise, points to the first dimension.