Skip to content

enums

Classes

AirTensorDim

AIR tensor dimensions.

Attributes:

  • N (int) –

    Batch dimension.

  • H (int) –

    Height dimension.

  • W (int) –

    Width dimension.

  • C (int) –

    Channel dimension.

AirSpatialPad

AIR spatial padding specification.

Attributes:

  • top (int) –

    Padding on the top.

  • bottom (int) –

    Padding on the bottom.

  • left (int) –

    Padding on the left.

  • right (int) –

    Padding on the right.

AirPaddingType

AIR padding types for AIR operators.

Attributes:

  • SAME (int) –

    Same padding.

  • VALID (int) –

    Valid padding.

AirTensorType

AIR tensor data types.

AirActivationType

AIR activation function types.

Attributes:

  • NONE (str) –

    No activation.

  • RELU (str) –

    ReLU activation.

  • RELU_N1_TO_1 (str) –

    ReLU activation with range [-1, 1].

  • RELU_0_TO_1 (str) –

    ReLU activation with range [0, 1].

  • RELU6 (str) –

    ReLU activation with range [0, 6].

  • TANH (str) –

    Tanh activation.

  • SIGN_BIT (str) –

    Sign bit activation.

  • PRELU (str) –

    Parametric ReLU activation.

Functions

compute_range
compute_range(output_zero_point: int, output_scale: float, *, dtype: DTypeLike | None = None, qmin: int | None = None, qmax: int | None = None, num_bits: int | None = None, signed: bool | None = None) -> tuple[int, int]

Compute quantized activation clamp range.

Precedence for the quantized range

1) dtype (e.g., np.int8 / np.uint8 / np.int16) 2) (num_bits, signed) (e.g., 4-bit signed) 3) qmin/qmax (explicit) 4) default to int8: [-128, 127]

AirTensorKind

AIR tensor kinds.

Attributes:

  • CONSTANT (str) –

    Constant tensors (read-only).

  • PERSISTENT (str) –

    Persistent including resource variables (read-write).

  • SCRATCH (str) –

    Scratch tensors for ops (read-write).

AirReluType

AIR RELU types.

Attributes:

  • RELU (str) –

    ReLU activation.

  • RELU6 (str) –

    ReLU6 activation.

  • RELU_N1_TO_1 (str) –

    ReLU activation with range [-1, 1].

  • RELU_0_TO_1 (str) –

    ReLU activation with range [0, 1].

Functions

compute_range
compute_range(output_zero_point: int, output_scale: float, *, dtype: DTypeLike | None = None, qmin: int | None = None, qmax: int | None = None, num_bits: int | None = None, signed: bool | None = None) -> tuple[int, int]

Compute quantized activation clamp range.

Precedence for the quantized range

1) dtype (e.g., np.int8 / np.uint8 / np.int16) 2) (num_bits, signed) (e.g., 4-bit signed) 3) qmin/qmax (explicit) 4) default to int8: [-128, 127]

AirComparisonType

AIR comparison operation types.

AirFullyConnectedWeightsFormat

AIR fully-connected weights format.

Attributes:

  • DEFAULT (int) –

    Default weights format.

  • SHUFFLED4x16INT8 (int) –

    Shuffled 4x16 INT8 weights format.

AirOpType

AIR supported operator types.