yet-another-onnx-builder documentation#

core scikit-learn tensorflow pytorch https://github.com/xadupre/yet-another-onnx-builder/actions/workflows/docs.yml/badge.svg https://github.com/xadupre/yet-another-onnx-builder/actions/workflows/style.yml/badge.svg https://github.com/xadupre/yet-another-onnx-builder/actions/workflows/spelling.yml/badge.svg https://codecov.io/gh/xadupre/yet-another-onnx-builder/branch/main/graph/badge.svg https://img.shields.io/github/repo-size/xadupre/yet-another-onnx-builder

yet-another-onnx-builder on GitHub

yet-another-onnx-builder (yobx) proposes a unique API to convert machine learning models to ONNX format and manipulating ONNX graphs programmatically. It can export from many libraries. Each converters relies on a common GraphBuider API (GraphBuiderExtendedProtocol) to build the final ONNX model. One default implementation is provided but it can also be replaced by any implementation of your own. Any user can implement its own. You can see OnnxScriptGraphBuilder or yobx.builder.spox.gridge_graph_spox.SpoxGraphBuilder for a reference. These API are close to onnx API, using NodeProto for nodes and strings for names. This is on purpose: what this API produces is what you see in the final ONNX model. You can add your own metadata, choose your own names.

standard machine learning

data manipulations

This is work in progress. Many packages produce SQL queries. It starts by converting a SQL query into ONNX.

deep learning

It also provides:

  • A graph builder API for constructing and optimizing ONNX graphs, with built-in shape inference and a pattern-based graph optimizer.

  • Converters for scikit-learn estimators and pipelines (yobx.sklearn).

  • Utilities for PyTorch export, including model patching and input flattening (yobx.torch).

  • A symbolic shape expression system for dynamic shape handling at export time.

  • A translation tool that converts ONNX graphs back to executable Python code.

  • Optimization functions to make the model more efficient.

  • It supports multiple opsets and multiple domains.

  • It allows the user to directly onnx model with spox or onnxscript/ir-py.

Its unique API:

# the model is called
expected = model(*args, **kwargs)
onnx_model = to_onnx(model, args, kwargs, dynamic_shapes, **options)

Indices and tables#

Older versions#