Skip to content

aot_transform

Classes

AotTransform

AotTransform(enabled: bool = True)

Functions

apply abstractmethod
apply(model: ModelT, subgraph: SubGraphT, operations: list[Type[AotOperator]]) -> tuple[litert.ModelT, litert.SubGraphT, list[Type[AotOperator]]]

Perform the transform on the given (model, subgraph, ops) triple. Return the potentially new (model, subgraph, ops).

Parameters:

  • model
    (ModelT) –

    The model to transform.

  • subgraph
    (SubGraphT) –

    The subgraph to transform.

  • operations
    (list[Type[AotOperator]]) –

    The list of operations to transform.

Returns:

  • tuple[ModelT, SubGraphT, list[Type[AotOperator]]]

    tuple[litert.ModelT, litert.SubGraphT, list[Type["AotOperator"]]]: The transformed model, subgraph, and operations.

Functions

register_transform

register_transform(cls: Type[AotTransform]) -> Type[AotTransform]

Class decorator: register each transform by its NAME.