Skip to main content

Crate svod_onnx

Crate svod_onnx 

Source
Expand description

ONNX model frontend for Svod.

This crate provides ONNX model parsing and conversion to Svod Tensors.

§Example

use svod_onnx::OnnxImporter;

// Import model — returns inputs, outputs, and variables as normal Svod types
let model = OnnxImporter::new().import("model.onnx", &[("batch", 4)])?;

// Outputs are lazy Tensors — realize to execute
let result = model.outputs["output"].realize()?;

// Dynamic dimensions are auto-extracted as Variables
for (name, var) in &model.variables {
    println!("{name}: bounds {:?}", var.bounds());
}

Re-exports§

pub use error::Error;
pub use error::Result;
pub use importer::OnnxImporter;
pub use importer::OnnxModel;

Modules§

error
Error types for ONNX parsing and import.
importer
ONNX model importer - converts ONNX protobuf to Svod Tensors.
parser
ONNX protobuf types generated by prost.
registry
ONNX operator registry - maps ONNX ops to Svod Tensor operations.