--- id: sog4onnx version: "1.0.17" license: MIT License license_treatment: permissive maintenance: dormant --- # sog4onnx — Simple ONNX operation generator. Simple Operation Generator for ONNX. License: permissive · Maintenance: dormant · Downloads: 84.3K/mo ## 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 above — 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 pip install sog4onnx uv add sog4onnx 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_current - Install friction: low - Maintenance: dormant - Downloads: 84.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags onnx operation generator, create single onnx op, onnx graph builder, generate onnx models, onnx op definition tool, onnx, model-generation, ml-tooling [View on SkillFed](https://skillfed.io/packages/sog4onnx) · [View on PyPI](https://pypi.org/project/sog4onnx/)