skillfed

sog4onnx

Simple ONNX operation generator. Simple Operation Generator for ONNX.

sog4onnx v1.0.17 84.3K downloads/30d#14,012 on PyPI7
Permissive license MIT License DORMANT released

What it is and what it does

sog4onnx is a command-line and Python library tool for generating single ONNX operations with user-specified inputs, outputs, and attributes. It deliberately skips consistency checking of operation definitions, allowing it to adapt as ONNX's opset evolves without requiring updates. The tool is designed as a building block: you define one operation at a time, then combine multiple generated operations using companion tools to construct complete ONNX graphs.

The package supports both CLI and in-script usage, accepting operation type, opset version, IR version, variable names and shapes, and operation-specific attributes. It outputs either a Python ModelProto object or a serialized .onnx file. Because it performs no validation, you must consult the ONNX operator documentation to ensure your inputs and attributes are correct for the operation you're generating.

Use it for:

  • Generate a single ONNX Gemm operation with custom input shapes and attributes for matrix multiplication.
  • Create minimal ONNX graphs for testing or prototyping new operation combinations before building full models.
  • Build operation definitions programmatically when constructing dynamic ONNX graphs from external specifications.
  • Generate Add, NonMaxSuppression, or other standard operations with precise control over tensor shapes.

Worth the install?

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

Generates minimal ONNX operation graphs by specifying operation type, inputs, outputs, and attributes without external runtime dependencies.

Yes, if you need to generate individual ONNX operations programmatically or via CLI and plan to combine them with companion tools. The low install friction and permissive MIT license make it a safe addition. However, dormant maintenance since April 2024 means you should verify compatibility with your target ONNX opset version before relying on it in production.

Install

sog4onnx on PyPI

pip

pip install sog4onnx

uv

uv add sog4onnx

poetry

poetry add sog4onnx

Installing sog4onnx

Before you install

Low install friction; pure Python wheel with no runtime dependencies. Maintenance is dormant—last release was 836 days ago, though the repository remains active with a final commit in April 2024.

License in practice

MIT License permits commercial and private use with minimal restrictions; suitable for most projects.

Quickstart

pip install sog4onnx

from sog4onnx import generate

single_op_graph = generate(
    op_type='Add',
    opset=11,
    ir_version=9,
    op_name='add_op',
    input_variables={'i1': [float, [1,2,3]], 'i2': [float, [1,2,3]]},
    output_variables={'o1': [float, [1,2,3]]}
)

Verify before relying

  • Whether the package handles validation of operation definitions against the ONNX specification version being used.
  • Whether generated graphs can be directly used with ONNX Runtime or require post-processing via companion tools.
  • Current compatibility with recent ONNX opset versions beyond the April 2024 release date.

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 — 836 days since the last release
Last repo commit
First released
Downloads 84,252/month — #14,012 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sog4onnx-1.0.17-py3-none-any.whl

Tags

onnx operation generatorcreate single onnx oponnx graph buildergenerate onnx modelsonnx op definition tool
onnxmodel-generationml-tooling

More Artificial Intelligence packages