Model¶

class onnx_ir.Model(graph: Graph, *, ir_version: int, producer_name: str | None = None, producer_version: str | None = None, domain: str | None = None, model_version: int | None = None, doc_string: str | None = None, functions: Sequence[Function] = (), metadata_props: dict[str, str] | None = None)¶
doc_string¶
domain¶
graph¶
ir_version¶
model_version¶
producer_name¶
producer_version¶
display(*, page: bool = False) None¶

Pretty print the object.

Parameters:

page – Whether to page the output.

property functions: dict[tuple[str, str, str], Function]¶
graphs() Iterable[Graph][source]¶

Get all graphs and subgraphs in the model.

This is a convenience method to traverse the model. Consider using onnx_ir.traversal.RecursiveGraphIterator for more advanced traversals on nodes.

property meta: MetadataStore¶

The metadata store for intermediate analysis.

Write to the metadata_props if you would like the metadata to be serialized to the ONNX proto.

property metadata_props: dict[str, str]¶
property opset_imports: dict[str, int]¶