skillfed

ssi4onnx

Simple Shape Inference tool for ONNX.

ssi4onnx v1.0.4 82.7K downloads/30d#14,141 on PyPI3
Permissive license MIT License DORMANT released

What it is and what it does

ssi4onnx is a shape inference utility for ONNX models that automatically computes and fills in tensor dimension information that may be missing or incomplete. It works by analyzing the model graph structure and operator definitions to deduce output shapes from input specifications. The tool is useful when working with ONNX models that have been simplified, converted from other frameworks, or manually edited—situations where shape metadata may be incomplete or incorrect.

You can use it either as a command-line tool (passing ONNX files in and out) or as a Python library function that accepts an ONNX ModelProto object directly. The library has no external runtime dependencies beyond ONNX itself, making it lightweight to integrate into model processing pipelines. It's part of a broader ONNX processing toolkit maintained by PINTO0309.

Use it for:

  • Repair ONNX models with incomplete shape information before deploying to inference engines like TensorRT or ONNX Runtime.
  • Debug shape mismatches in converted models (e.g., from PyTorch or TensorFlow) by inferring correct tensor dimensions.
  • Preprocess ONNX graphs in a model optimization pipeline to ensure shape metadata is complete before further transformations.
  • Validate ONNX model structure by checking whether shape inference succeeds without errors.
  • Integrate shape inference into automated model conversion workflows for consistent shape annotation.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Infers and fills missing tensor shape information in ONNX model files, available as both a CLI tool and a Python library function.

Yes, if you work with ONNX models and need to repair or validate shape information. The package is lightweight (no runtime dependencies), permissively licensed, and solves a real problem in ONNX workflows. However, note that the project is dormant (last update 808 days ago), so expect no active maintenance or updates for recent ONNX features.

Install

ssi4onnx on PyPI

pip

pip install ssi4onnx

uv

uv add ssi4onnx

poetry

poetry add ssi4onnx

Installing ssi4onnx

Before you install

No runtime dependencies and a pure-Python wheel distribution make installation straightforward. The project is dormant (last update 808 days ago) but carries no known vulnerabilities.

License in practice

MIT License permits unrestricted use, modification, and distribution with minimal restrictions, making it safe to integrate into proprietary or open-source projects.

Quickstart

pip install ssi4onnx

from ssi4onnx import shape_inference

estimated_graph = shape_inference(
    input_onnx_file_path="model.onnx"
)

Requires ONNX to be installed separately; the package itself has no runtime dependencies but expects an ONNX model file as input.

Verify before relying

  • Whether shape inference handles all ONNX operator types or has known limitations on specific model architectures.
  • Performance characteristics on large or complex ONNX graphs.
  • Compatibility with recent ONNX opset versions beyond the package's last update.

Package facts

License MIT License (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 808 days since the last release
Last repo commit
First released
Downloads 82,710/month — #14,141 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: ssi4onnx-1.0.4-py3-none-any.whl

Tags

onnx shape inferencetensor shape estimationonnx model processinginfer missing shapes onnxonnx graph shape completionneural network model shape analysisonnx model debugging
onnx-toolsmodel-processingshape-inference

More Artificial Intelligence packages