Skip to content

model_handler

Classes

ModelHandler

ModelHandler(model: ModelT, subgraph: SubGraphT, operators: list[AotOperator], config: ConvertArgs)

Functions

compute_values
compute_values(mem_alloc: dict[int, int], total_mem: int) -> dict[str, str]

Computes the values needed for generating the model source code.

Parameters:

  • mem_alloc
    (dict[int, int]) –

    Memory allocation for each tensor.

  • total_mem
    (int) –

    Total memory size.

Returns:

  • dict ( dict[str, str] ) –

    A dictionary containing the computed values for code generation.

generate_source_code
generate_source_code(mem_alloc: dict[int, int], total_mem: int, save_path: Path)

Generate the source code for the main inference model.

Parameters:

  • mem_alloc
    (dict[int, int]) –

    Memory allocation for each tensor.

  • total_mem
    (int) –

    Total memory size.

  • save_path
    (Path) –

    Path to save the generated code.

Functions