Struct Qnn_TensorV2_t

Nested Relationships

Struct Documentation

struct Qnn_TensorV2_t

A struct which describes the properties of a V2 version of tensor.

Public Members

uint32_t id

Unique integer identifier for a tensor, generated by the backend based on the tensor name.

const char *name

Unique tensor name.

Qnn_TensorType_t type

Tensor type.

Qnn_TensorDataFormat_t dataFormat

Tensor data formatting in memory (refer to definition type for info).

Qnn_DataType_t dataType

Tensor data type.

Qnn_QuantizeParams_t quantizeParams

Tensor quantization params.

uint32_t rank

Tensor rank. Note that rank cannot be dynamic.

uint32_t *dimensions

Tensor dimension array of length rank. For detailed behavior of dimensions field with various APIs, refer to their API documentation. Must be NULL when rank is 0. Must contain non-zero values if non-null.

Qnn_TensorMemType_t memType

Tensor memory type.

uint8_t *isDynamicDimensions

A boolean array of length rank indicating if a tensor dimension is dynamic. Must be NULL when rank is 0. Can be NULL if all dimensions are static. A true (non-zero) value indicates the corresponding dimension is dynamic and a false (zero) value indicates the corresponding dimension is static. Note that QNN_TENSOR_TYPE_STATIC tensors (see type) cannot have dynamic dimensions. Support for this field can be queried via QNN_PROPERTY_TENSOR_SUPPORT_DYNAMIC_DIMENSIONS. If this field is unsupported, it must be NULL.

Qnn_SparseParams_t sparseParams

Sparse tensor parameters. Pertains only to sparse tensors (see QNN_TENSOR_DATA_FORMAT_SPARSE). Support for this field can be queried via QNN_PROPERTY_TENSOR_SUPPORT_SPARSITY.

uint8_t isProduced

Indicates whether or not a call to QnnGraph_execute[Async] produced this output tensor. Applicable only to QNN_TENSOR_TYPE_APP_READ and QNN_TENSOR_TYPE_APP_READWRITE tensor types. This field will be undefined if QNN_PROPERTY_GRAPH_SUPPORT_EARLY_TERMINATION is not supported. Otherwise, this field is not used.

union unnamed

Actual data contained in the tensor.

Public Members

Qnn_ClientBuffer_t clientBuf

Tensor data provided by client as a pointer to raw memory (see QNN_TENSORMEMTYPE_RAW).

Qnn_MemHandle_t memHandle

Tensor data shared via a memory handle (see QNN_TENSORMEMTYPE_MEMHANDLE).

Qnn_TensorRetrieveRaw_t *retrieveRaw

Tensor data provided by client as a raw pointer retrieved through a callback (QNN_TENSORMEMTYPE_RETRIEVE_RAW)