Struct Qnn_BlockwiseExpansion_t

Nested Relationships

Struct Documentation

struct Qnn_BlockwiseExpansion_t

A struct to express block-wise expansion quantization parameters.

Note

This quantization encoding must not be used with dynamically shaped tensors.

Public Members

int32_t axis

The dimension (typically the channel dimension)

Qnn_ScaleOffset_t *scaleOffsets

Array of size axisSize of scale offset pairs.

uint32_t numBlocksPerAxis

Number of blocks within the axis.

uint32_t blockScaleBitwidth

Block bitwidth (e.g. 12 bits for 4 to 16 expansion)

Qnn_BlockwiseExpansionBlockScaleStorageType_t blockScaleStorageType

Size of the block scaling storage, must be able to store at least blockScaleBitwidth sized values.

union unnamed

Public Members

uint8_t *blocksScale8

A contiguous array of block scalings of size axisSize*numBlocksPerAxis. The array is laid out such that an element can be accessed via blocksScale8[axisIter*numBlocksPerAxis+blockIter]. Used when blockStorageSize is QNN_BLOCKWISE_EXPANSION_BITWIDTH_SCALE_STORAGE_8.

uint16_t *blocksScale16

A contiguous array of block scalings of size axisSize*numBlocksPerAxis. The array is laid out such that an element can be accessed via blocksScale16[axisIter*numBlocksPerAxis+blockIter]. Used when blockStorageSize is QNN_BLOCKWISE_EXPANSION_BITWIDTH_SCALE_STORAGE_16.