onnx-export-rs 0.1.1

Export canonical Rust machine-learning models to ONNX
Documentation
1
2
3
4
5
6
7
8
9
10
11
//! Writes a small linear-regression ONNX model to `linear.onnx`.

use ndarray::array;
use onnx_export_rs::{
    canonical::LinearModelWeights, exporters::export_linear, save_to_file, Result,
};

fn main() -> Result<()> {
    let weights = LinearModelWeights::new(array![2.0, -1.0, 0.5], 0.25);
    save_to_file(&export_linear(&weights), "linear.onnx")
}