from_onnx_text¶

onnx_ir.from_onnx_text(model_text, /, initializers=None)¶

Convert the ONNX textual representation to an IR model.

Read more about the textual representation at: https://onnx.ai/onnx/repo-docs/Syntax.html

Parameters:
  • model_text (str) – The ONNX textual representation of the model.

  • initializers (Iterable[TensorProtocol] | None) – Tensors to be added as initializers. If provided, these tensors will be added to the model as initializers. If a name does not exist in the model, a ValueError will be raised.

Returns:

The IR model corresponding to the ONNX textual representation.

Raises:

ValueError – If a tensor name in initializers does not match any value in the model.

Return type:

Model