Skip to main content

ONNX IR

PyPI - Version Ruff codecov PyPI Downloads

An in-memory IR that supports the full ONNX spec, designed for graph construction, analysis and transformation.

Getting Started

onnx-ir documentation

Installation

Via pip:

pip install onnx-ir

Or from source:

pip install git+https://github.com/onnx/ir-py.git

Features ✨

  • Full ONNX spec support: all valid models representable by ONNX protobuf, and a subset of invalid models (so you can load and fix them).
  • Low memory footprint: mmap'ed external tensors; unified interface for ONNX TensorProto, Numpy arrays and PyTorch Tensors etc. No tensor size limitation. Zero copies.
  • Straightforward access patterns: Access value information and traverse the graph topology at ease.
  • Robust mutation: Create as many iterators as you like on the graph while mutating it.
  • Speed: Performant graph manipulation, serialization/deserialization to Protobuf.
  • Pythonic and familiar APIs: Classes define Pythonic apis and still map to ONNX protobuf concepts in an intuitive way.
  • No protobuf dependency: The IR does not require protobuf once the model is converted to the IR representation, decoupling from the serialization format.

Concept Diagram

Concept Diagram

Code Organization 🗺️

  • _protocols.py: Interfaces defined for all entities in the IR.
  • _core.py: Implementation of the core entities in the IR, including Model, Graph, Node, Value, and others.
  • _enums.py: Definition of the type enums that correspond to the DataType and AttributeType in onnx.proto.
  • _name_authority.py: The authority for giving names to entities in the graph, used internally.
  • _linked_list.py: The data structure as the node container in the graph that supports robust iteration and mutation. Internal.
  • _metadata.py: Metadata store for all entities in the IR.

Release files for onnx-ir 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onnx-ir 1.0.0
File Size Uploaded
onnx_ir-1.0.0.tar.gz 163.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for onnx-ir 1.0.0
File Interpreter ABI Platform
onnx_ir-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 349.0 kB

Release files / onnx_ir-1.0.0.tar.gz

Download URL onnx_ir-1.0.0.tar.gz
Size 163.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9e261f25fde8da9612ae5cb43b3b374d5ff469c04af0363cad588b2bb000b812
BLAKE2b-256 checksum
How to use checksums
d6c261194cec0dbc5622273c0ebd592d37cc1dca0d7f1a744f02edd45ac905a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 11, 2026.

Transparency log

Release files / onnx_ir-1.0.0-py3-none-any.whl

Download URL onnx_ir-1.0.0-py3-none-any.whl
Size 185.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e578f0d608d3062866b48223616eb2d10a6d6d01f8b8faac596129034f483cc7
BLAKE2b-256 checksum
How to use checksums
91cd6d1637172eb59c7b18ac90ed089d1f599a11fe0e63b4db2d017f3bb38a32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.15

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page