yobx.jax#

Converts JAX functions directly into native onnx-light graphs.

Converts JAX callables into native onnx-light graphs.

yobx.jax.convert.to_onnx(model: ~typing.Callable, args: ~typing.Tuple[~typing.Any, ...], input_names: ~typing.Sequence[str] | None = None, dynamic_shapes: ~typing.Tuple[~typing.Dict[int, str], ...] | None = None, target_opset: int | ~typing.Dict[str, int] = 29, builder_cls: type | ~typing.Callable = <class 'yobx.builder.onnxlight.bridge_graph_builder.OnnxLightGraphBuilder'>, verbose: int = 0, extra_converters: ~typing.Dict[str, ~typing.Callable] | None = None, large_model: bool = False, external_threshold: int = 1024, filename: str | None = None, return_optimize_report: bool = False) → ExportArtifact[source]#

Converts a JAX callable directly into an onnx-light export artifact.

Parameters:
  • model – JAX callable accepting positional array inputs.

  • args – Concrete sample inputs used to trace the JAX computation.

  • input_names – Optional ONNX input names.

  • dynamic_shapes – Per-input mappings from axes to symbolic dimension names. By default, axis zero of each non-scalar input is named batch.

  • target_opset – ONNX opset version or domain-to-version mapping.

  • builder_cls – Native graph builder class.

  • verbose – Builder verbosity.

  • extra_converters – Reserved for signature compatibility. It must be None.

  • large_model – Enables external tensor storage.

  • external_threshold – Minimum number of elements stored externally.

  • filename – Optional path to save the resulting artifact.

  • return_optimize_report – Includes native optimization statistics.

Returns:

An export artifact containing an onnx-light model.