onnx_extended.tools.onnx_inline

onnx_inline_function

onnx_extended.tools.onnx_inline.onnx_inline_function(obj: FunctionProto | GraphProto | ModelProto, protos: Dict[str, Any] | None = None, existing_names: Set[str] | None = None, verbose: int = 0) Tuple[FunctionProto | GraphProto | ModelProto, List[NodeProto]][source]

Inlines functions in an ONNX graph.

Parameters:
  • obj – onnx graph, FunctionProto, GraphProto, ModelProto

  • protos – if None, the function assumes obj is of type ModelProto and the goal is to inline every function. If protos a list of strings, the function only inlines the functions in that list. If protos is a dictionary { (domain, type): FunctionProto }, the function replaces every node (domain, type) by the code given in this dictionary

  • existing_names – no new name will be taken in that set

  • verbose – verbosity

Returns:

modified object, list of modified nodes