PassBase¶

class onnx_ir.passes.PassBase¶

Base class for all passes.

in_place and changes_input properties and what they mean:

changes_inputs

not changes_inputs

in_place

in place

Side-effect-only pass

not in_place

destructive

functional

abstract call(model: Model) PassResult[source]¶

The main entry point for the pass.

abstract property changes_input: bool¶

Whether the pass modifies input model.

property destructive: bool¶

Whether the pass will destroy the input model when in_place=False.

A pass is destructive if it is not in place and it modifies the input model.

ensures(model: Model) None[source]¶

Post-conditions for the pass.

This is optional to implement, will be called after call() if run by a pass manager.

abstract property in_place: bool¶

Whether the pass modifies the model in place and returns it.

If True, the pass will return the same model object that was passed in. If False, the pass will return a new model object.

requires(model: Model) None[source]¶

Pre-conditions for the pass.

This is optional to implement, will be called before call() if run by a pass manager.