Tiny, no-nonsense, self contained, portable inference.
use tract_tensorflow::prelude::*;
let tf = tensorflow();
let mut model = tf.model_for_path("tests/models/plus3.pb").unwrap();
model.set_input_fact(0, InferenceFact::dt_shape(f32::datum_type(), tvec!(3))).unwrap();
let model = model.into_optimized().unwrap();
let plan = SimplePlan::new(&model).unwrap();
let input = tensor1(&[1.0f32, 2.5, 5.0]);
let mut outputs = plan.run(tvec![input]).unwrap();
let mut tensor = outputs.pop().unwrap();
assert_eq!(tensor, rctensor1(&[4.0f32, 5.5, 8.0]));