Class OnnxExport

java.lang.Object
ai.beestream.jitnn.onnx.OnnxExport

public final class OnnxExport extends Object
Writes a jitNN forward pass as an ONNX model (opset 20), for ONNX Runtime and the other ONNX tools. The forward pass is recorded once on example inputs, without running it: every recorded operator becomes ONNX operators, parameters and other constants become initializers, and the example inputs become the graph inputs. Shapes are those of the example inputs (no dynamic axes). Weights are written in FP32. Operators without an ONNX mapping are reported by name.
model.train(false);
OnnxExport.export(Path.of("model.onnx"), x -> model.forward(x[0]), new Tensor[] { example }, new String[] { "input" }, "output");