Skip to content

aot_model

AotModel API

The AotModel class is responsible for converting a LiteRT model into an AOT (Ahead-Of-Time) inference C module.

Classes:

  • AotModel

    Represents the AOT model conversion process.

Copyright 2025 Ambiq. All Rights Reserved.

Classes

AotModel

AotModel(config: ConvertArgs)

AOT model

This class is responsible for generating the C inference module for the model.

Parameters:

  • config

    (ConvertArgs) –

    Configuration object containing parameters for conversion.

Attributes

module_path cached property
module_path

Return the module path.

subgraph property
subgraph: SubGraphT

Return the subgraph of the model.

Functions

initialize
initialize()

Initialize the AOT model.

This method sets up the module directory structure, initializes operators, and memory planner.

validate
validate()

Perform validation checks on the model and subgraph.

fuse_and_transform_operators
fuse_and_transform_operators()

Perform operator fusion and transformation.

This method applies operator fusion and other transformations to the model graph.

generate_source_code
generate_source_code()

Generates all source code for the module.

generate_operator_source_code
generate_operator_source_code()

Generates the C source code for all operators.

This method creates the source code files for each operator in the model.

generate_module
generate_module()

Generates the module files based on the module type.

export_module
export_module()

Export the module to the specified path.

generate_documentation
generate_documentation()

Generates the documentation files for the module.

Functions