AotConverter
PythonConverts a trained model into a self-contained AOT inference C module.
AotConverter(config: ConvertArgs, registry_context: RegistryContext | None = None)Converts a trained model into a self-contained AOT inference C module.
The converter owns the six-stage pipeline (Load, Transform, Resolve, Plan,
Emit, Export) described on convert(), which is the single entry point;
the CLI is a thin wrapper around it. All behavior is driven by the
ConvertArgs config supplied at construction,
and every dispatch (parsers, operator classes, transforms) goes through the
registry context, so a caller can extend the compiler without patching it.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
config | ConvertArgs | Required | Conversion parameters. |
registry_context | RegistryContext | None | None | Optional registry context for parser/operator/transform dispatch. If omitted, a fresh default frozen context is created. |
config
Pythonconfig: ConvertArgs = configConversion parameters.
registry_context
Pythonregistry_context = registry_context or build_default_registry_context()Registry context used for parser, operator and transform dispatch.
convert
PythonConvert the model to an AOT module.
convert() -> CodeGenContextConvert the model to an AOT module.
Code is generated in a temporary work directory that is removed once
the conversion ends, whether it succeeds or fails, unless
keep_work_dir is set.
Returns
| Value | Type | Description |
|---|---|---|
CodeGenContext | CodeGenContext | Code generation context. Its ``work_path`` no |
CodeGenContext | longer exists unless ``keep_work_dir`` is set. |