Enum Qnn_QuantizationEncodingMapping_t

Enum Documentation

enum Qnn_QuantizationEncodingMapping_t

An enum to specify quantized value mapping scheme.

Values:

enumerator QNN_QUANTIZATION_ENCODING_MAPPING_STANDARD_SYMMETRIC = 0

Indicates standard symmetric 2’s compliment mapping For 2-bit quantization, signed values {-2, -1, 0, 1} map directly to {-2, -1, 0, 1}

enumerator QNN_QUANTIZATION_ENCODING_MAPPING_ASYMMETRIC_PLUS_ONE = 1

Indicates 2’s compliment mapping with a positive shift of one For 2-bit quantization, signed values {-2, -1, 0, 1} map to {-1, 0, 1, 2} with dequantized values recoverable with scale * {-1, 0, 1, 2}

enumerator QNN_QUANTIZATION_ENCODING_MAPPING_LINEAR_SYMMETRIC_EXCLUDE_ZERO = 2

Indicates linear mapping symmetric about zero, but excluding zero from the range For tensors with signed dataType dequantized values are recovered with: w = scale * (w_q + 0.5) For tensors with unsigned dataType dequantized values are recovered with: w = scale * (w_q - 2^(bitwidth - 1) + 0.5) For 2-bit quantization, signed values {-2, -1, 0, 1} map to {-1.5, -0.5, 0.5, 1.5} with dequantized values recoverable with scale * {-1.5, -0.5, 0.5, 1.5}

enumerator QNN_QUANTIZATION_ENCODING_MAPPING_UNDEFINED = 0x7FFFFFFF