Skip to content

prune_identity_ops

Classes

PruneIdentityOpsOptions

Options for the PruneIdentityOps transform.

PruneIdentityOps

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

The purpose of this transform is to make identity ops into no-ops.

Identity operators are those that only change the view but not the data itself, such as EXPAND_DIMS, RESHAPE, and SQUEEZE.

  1. Find any identity operator where subsequent operators dont rely on input tensor.
  2. If found, set output tensor as alias of input tensor.

Functions

apply
apply(model: AirModel) -> AirModel

Apply the transform.

Parameters:

  • model
    (AirModel) –

    The model to transform.

Returns:

  • AirModel ( AirModel ) –

    The transformed model.

Functions