Skip to main content

export_sequential_to_onnx

Function export_sequential_to_onnx 

Source
pub fn export_sequential_to_onnx(
    model: &SequentialModel,
    graph: &Graph,
    input_shape: &[i64],
    producer_name: &str,
    model_name: &str,
) -> Result<Vec<u8>, ModelError>
Expand description

Exports a SequentialModel to an ONNX protobuf byte vector.

input_shape is the full shape including batch dimension, e.g. [1, 28, 28, 1] for NHWC. Linear layer weights are read from the autograd graph.