onnx_ir¶

Functions and constructors¶

onnx_ir.load

Load an ONNX model from a file.

onnx_ir.save

Save an ONNX model to a file.

onnx_ir.from_proto

Deserialize an ONNX proto message to an IR object.

onnx_ir.from_onnx_text

Convert the ONNX textual representation to an IR model.

onnx_ir.to_proto

Serialize an IR object to a proto.

onnx_ir.tensor

Create a tensor value from an ArrayLike object or a TensorProto.

onnx_ir.node

Create an ir.Node.

Classes¶

onnx_ir.TensorProtocol

Concrete tensor backed by data.

onnx_ir.Value

IR Value.

onnx_ir.Node

IR Node.

onnx_ir.Graph

IR Graph.

onnx_ir.Model

onnx_ir.GraphView

A read-only view on a graph.

onnx_ir.Function

IR functions.

onnx_ir.Attr

Base class for ONNX attributes or references.

onnx_ir.Shape

The shape of a tensor, including its dimensions and optional denotations.

onnx_ir.SymbolicDim

Immutable symbolic dimension that can be shared across multiple shapes.

onnx_ir.TypeAndShape

Type and shape.

onnx_ir.TensorType

A type that represents a tensor.

onnx_ir.SparseTensorType

A type that represents a sparse tensor.

onnx_ir.SequenceType

A type that represents a sequence of elements.

onnx_ir.OptionalType

A type that represents an optional element.

onnx_ir.Tensor

An immutable concrete tensor.

onnx_ir.ExternalTensor

An immutable concrete tensor with its data store on disk.

onnx_ir.StringTensor

Multidimensional array of strings (as binary data to match the string_data field in TensorProto).

onnx_ir.LazyTensor

A tensor that lazily evaluates a function to get the actual tensor.

Enums¶

onnx_ir.DataType

Enum for the data types of ONNX tensors, defined in onnx.TensorProto.

onnx_ir.AttributeType

Enum for the types of ONNX attributes.