Skip to content

sqrt

Classes

SqrtOperator

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

SQRT operator.

This operator computes the element-wise square root of a float tensor.

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

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

Compute template values for the operator.

emit
emit(save_path: Path)

Generate the source code for the operator.

Functions

make_sqrt_lut

make_sqrt_lut(input_scale: float, input_zero_point: int, output_scale: float, output_zero_point: int) -> np.ndarray

Build a 256-entry int8 SQRT LUT.