LiftConstantsToInitializersPass¶

class onnx_ir.passes.common.LiftConstantsToInitializersPass(lift_all_constants=False, size_limit=16)[source]¶

Lift constants to initializers.

Parameters:
  • lift_all_constants (bool)

  • size_limit (int)

lift_all_constants¶

Whether to lift all Constant nodes, including those that does not contain a tensor attribute (e.g. with value_ints etc.) Default to False, where only Constants with the value attribute are lifted.

size_limit¶

The minimum size of the tensor to be lifted. If the tensor contains number of elements less than size_limit, it will not be lifted. Default is 16.

call(model)[source]¶

The main entry point for the pass.

Parameters:

model (Model)

Return type:

PassResult