Skip to content

transform

Classes

AirTransform

AirTransform(enabled: bool = True, options: dict[str, Any] = None)

Base class for all AIR model fusion/transformations.

Initialize the transform.

Parameters:

  • enabled

    (bool, default: True ) –

    Whether the transform is enabled. Defaults to True.

  • options

    (dict[str, Any], default: None ) –

    Options for the transform. Defaults to None.

Attributes

name property
name: str

Unique name of the transform.

Functions

apply abstractmethod
apply(model: AirModel) -> AirModel

Perform the transform on the given model.

Parameters:

  • model
    (AirModel) –

    The model to transform.

Returns:

  • AirModel ( AirModel ) –

    The transformed model.

Functions

register_transform

register_transform(cls: type[AirTransform]) -> type[AirTransform]

Class decorator: register each transform by its NAME.

get_transform

get_transform(name: str) -> type[AirTransform]

Get a transform by its name.