onnx-helpers
ONNX graph construction helpers.
Usage
[]
= { = "https://github.com/crackcomm/onnx-helpers-rs.git" }
Example
use *;
use DataType;
Credits
Based on onnx-rs.
License
MIT license same as ONNX.
ONNX graph construction helpers.
[dependencies]
onnx-helpers = { git = "https://github.com/crackcomm/onnx-helpers-rs.git" }
use onnx_helpers::prelude::*;
use onnx_pb::tensor_proto::DataType;
fn main() {
let mut graph = builder::Graph::new("add");
let x = graph.input("X").typed(DataType::Float).dim(1).dim(6).node();
let two = graph.constant("two", 2.0f32);
let graph = graph.outputs(-(&x - x.mean(1, true)) * two + x);
let model = graph.model().build();
save_model("mean-reverse.onnx", &model).unwrap();
}
Based on onnx-rs.
MIT license same as ONNX.