Skip to content

enums

Classes

AirTensorDim

AIR tensor dimensions.

Attributes:

  • N (int) –

    Batch size dimension.

  • H (int) –

    Height dimension.

  • W (int) –

    Width dimension.

  • C (int) –

    Channel dimension.

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.

Functions

compute_range
compute_range(output_zero_point: int, output_scale: float, qmin: int = -128, qmax: int = 127) -> tuple[int, int]

Compute the activation min and max values

Parameters:

  • output_zero_point
    (int) –

    The zero point for the output tensor.

  • output_scale
    (float) –

    The scale for the output tensor.

  • qmin
    (int, default: -128 ) –

    Minimum quantized value. Defaults to -128.

  • qmax
    (int, default: 127 ) –

    Maximum quantized value. Defaults to 127.

Returns:

  • tuple[int, int]

    tuple[int, int]: The activation min and max values.

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, qmin: int = -128, qmax: int = 127) -> tuple[int, int]

Compute the activation min and max values

Parameters:

  • output_zero_point
    (int) –

    The zero point for the output tensor.

  • output_scale
    (float) –

    The scale for the output tensor.

  • qmin
    (int, default: -128 ) –

    Minimum quantized value. Defaults to -128.

  • qmax
    (int, default: 127 ) –

    Maximum quantized value. Defaults to 127.

Returns:

  • tuple[int, int]

    tuple[int, int]: The activation min and max values.

AirFullyConnectedWeightsFormat

AIR fully-connected weights format.

Attributes:

  • DEFAULT (int) –

    Default weights format.

  • SHUFFLED4x16INT8 (int) –

    Shuffled 4x16 INT8 weights format.

AirOpType

AIR supported operator types.