An in-memory IR that supports the full ONNX spec, designed for graph construction, analysis and transformation.
Getting Started
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
Code Organization 🗺️
_protocols.py: Interfaces defined for all entities in the IR._core.py: Implementation of the core entities in the IR, includingModel,Graph,Node,Value, and others._enums.py: Definition of the type enums that correspond to theDataTypeandAttributeTypeinonnx.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)
| File | Size | Uploaded | |
|---|---|---|---|
| onnx_ir-1.0.0.tar.gz | 163.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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 logRelease 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