Skip to content

dequantize

Classes

DequantizeOperator

DequantizeOperator(op: AirOperator, model: AirModel, platform: SocPlatform, prefix: str = 'aot', attributes: dict[str, str] = {})

DEQUANTIZE operator.

This operator converts a quantized tensor to a float tensor.

Supported inputs: INT8, INT16, FLOAT16 (output must be FLOAT32).

Parameters:

  • op

    (AirOperator) –

    The AIR operator to wrap.

  • model

    (AirModel) –

    The AIR model.

  • platform

    (SocPlatform) –

    The target platform for code generation.

  • prefix

    (str, default: 'aot' ) –

    Prefix for generated code files. Defaults to "aot".

  • attributes

    (dict[str, str], default: {} ) –

    Attributes for template values. Defaults to {}.

Functions

validate
validate()

Validate the operator configuration.

cmsis_float_dependencies
cmsis_float_dependencies() -> set[type]

DEQUANTIZE's float dependency is limited to the native FP16 cast path.

DEQUANTIZE never calls a gated float kernel: arm_dequantize_s8_f32 / arm_dequantize_s16_f32 live in the ungated arm_nnfunctions.h and emit into a plain float buffer. The only path that touches the float-only ns-cmsis-nn API is the native FP16 input cast (available only on Armv8.1-M FP16 cores), which binds the input as float16_t — a type introduced by arm_nnfunctions_flt.h behind ARM_NN_ENABLE_F16. The portable FP16->FP32 widening path used on non-FP16 cores works purely on uint16_t bit patterns and therefore declares no dependency.

Returns:

  • set[type]

    set[type]: {np.float16} when the operator lowers to the native

  • set[type]

    FP16 cast; otherwise an empty set.

compute_values
compute_values() -> dict[str, str]

Compute the values for the operator.

Returns:

  • dict[str, str]

    dict[str, str]: Computed values for the operator.

emit
emit(save_path: Path)

Generate the source code for the operator.

Parameters:

  • save_path
    (Path) –

    Path to save the generated code.

Functions