Quantco/spox has 101 GitHub stars and 8 forks. Star changes are not measured yet. Last checked 2026-11-12 20:06 UTC. Last push 2026-11-10.
So werden diese Zahlen gemessen
Pythonic framework for building ONNX graphs
What you can do
- Eager operator validation and type inference
- Errors with Python tracebacks to offending operators
- First-class support for subgraphs (control flow)
- A lean and predictable API
Gemessener Sternzuwachs
- in 24h
- Verlauf wird gesammelt
- in 7 days
- Verlauf wird gesammelt
- in 15 days
- Verlauf wird gesammelt
- in 1 month
- Verlauf wird gesammelt
Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.
README.md
OriginalSpox
Spox makes it easy to construct ONNX models through clean and idiomatic Python code.
Why use Spox?
A common application of ONNX is converting models from various frameworks. This requires replicating their runtime behaviour with ONNX operators. In the past this has been a major challenge. Based on our experience, we designed Spox from the ground up to make the process of writing converters (and ONNX models in general) as easy as possible.
Spox's features include:
- Eager operator validation and type inference
- Errors with Python tracebacks to offending operators
- First-class support for subgraphs (control flow)
- A lean and predictable API
Installation
Spox releases are available on PyPI:
pip install spox
There is also a package available on conda-forge:
conda install spox
Quick start
In Spox, you primarily interact with Var objects - variables - which are placeholders for runtime values.
The initial Var objects, which represent the arguments of a model (the model inputs in ONNX nomenclature), are created with an explicit type using the argument(Type) -> Var function. The possible types include Tensor, Sequence, and Optional.
All further Var objects are created by calling functions which take existing Var objects as inputs and produce new Var objects as outputs. Spox determines the Var.type for these eagerly to allow validation.
Spox provides such functions for all operators in the standard. They are grouped by domain and version in the spox.opset submodule.
The final onnx.ModelProto object is built by passing input and output Vars for the model to the spox.build function.
Below is an example for defining an ONNX graph which computes the geometric mean of two inputs. Make sure to consult the Spox documentation to find more details and tutorials.
import onnx
from spox import argument, build, Tensor, Var
# Import operators from the ai.onnx domain at version 17
from spox.opset.ai.onnx import v17 as op
def geometric_mean(x: Var, y: Var) -> Var:
# use the standard Sqrt and Mul
return op.sqrt(op.mul(x, y))
# Create typed model inputs. Each tensor is of rank 1
# and has the runtime-determined length 'N'.
a = argument(Tensor(float, ('N',)))
b = argument(Tensor(float, ('N',)))
# Perform operations on `Var`s
c = geometric_mean(a, b)
# Build an `onnx.ModelProto` for the given inputs and outputs.
model: onnx.ModelProto = build(inputs={'a': a, 'b': b}, outputs={'c': c})
Credits
Original designed and developed by @jbachurski with the supervision of @cbourjau.
Ähnliche Projekte entdecken
tensorflow/tensorflow
Ein Open-Source-Framework für maschinelles Lernen für alle
201,584 Sternehuggingface/transformers
🤗 Transformers: das Framework zur Modelldefinition für State-of-the-Art-Modelle des maschinellen Lernens in Text, Vision, Audio und multimodal, für Inferenz und Training.
168,917 SterneAUTOMATIC1111/stable-diffusion-webui
Web-UI für Stable Diffusion
165,300 SterneComfy-Org/ComfyUI
Die leistungsstärkste und modularste GUI, API und das Backend für Diffusionsmodelle mit einer Oberfläche aus Graphen und Knoten. Die schnellste lokale Inferenz-Engine der Welt.
146,472 Sterne