InlinePass¶
- class onnx_ir.passes.common.InlinePass(criteria=None)[source]¶
Inline model local functions to the main graph and functions and remove unused functions.
When a node calls a function defined in the model and when
criteriais None orcriteria(function)returns True, the function body is inlined into the graph in place of the call node.Added in version 0.1.16: The
criteriaparameter.- Requires:
No cyclic dependencies between functions in the model.
- Parameters:
criteria (Callable[[ir.Function], bool] | None)
- criteria¶
Optional function that takes an
onnx_ir.Functionand returns True if the it should be inlined. If None, all function calls are inlined.