operator
Classes
AotOperator
AotOperator(op: AirOperator, model: AirModel, platform: SocPlatform, prefix: str = 'aot', attributes: dict[str, str] = {})
Base class for all AOT operators.
Execution flow:
1. Initialize the operator.
2. Call resolve()
to validate and prepare the operator.
3. Call plan()
to set up any necessary planning.
4. Call emit()
to generate the operator's code.
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 {}.
Attributes
Functions
resolve
Public entry point—only runs once, even if called repeatedly.
This method validates the AIR operator and performs any model mutations needed.
compute_values
emit
Generate the source code for the operator.
This method should be overridden by subclasses.
Parameters:
-
save_path
Path
) –Path to save the generated source code.