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.
Metadata
Release files for onnx-ir 1.1.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 | Provenance | Actions |
|---|---|---|---|---|
| onnx_ir-1.1.0.tar.gz | 169.0 kB | With provenance | Details for onnx_ir-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| onnx_ir-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for onnx_ir-1.1.0-py3-none-any.whl |
Total release size: 361.3 kB
Release files / onnx_ir-1.1.0.tar.gz
| Download URL | onnx_ir-1.1.0.tar.gz |
|---|---|
| Size | 169.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b72176de575d820ec26864d17270d58ef886a7cf64db7649d15fcc3d5ae2a8ee
|
|
BLAKE2b-256 checksum How to use checksums |
319c19dee739ae9a7c647ab16fdb990da1b73abe9aa604c4e3c5c30138acc693
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 20, 2026.
Transparency logRelease files / onnx_ir-1.1.0-py3-none-any.whl
| Download URL | onnx_ir-1.1.0-py3-none-any.whl |
|---|---|
| Size | 192.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
76cc313a788c073b75271c1b6abb172aaf90fcc6335ed40f9f3238b2064a2fa3
|
|
BLAKE2b-256 checksum How to use checksums |
eb801a63440081d94e25b96be6b29119f41119fe5c9521063edbdb7baeeb9589
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 20, 2026.
Transparency logSecurity for onnx-ir 1.1.0
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for onnx_ir-1.1.0.tar.gz
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 Oct 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.