Tiny, no-nonsense, self contained, portable SharedTensor inference.
use tract_core::*;
let model = tract_tensorflow::for_path("tests/models/plus3.pb").unwrap();
let plan = SimplePlan::new(&model).unwrap();
let input = ndarray::arr1(&[1.0f32, 2.5, 5.0]);
let mut outputs = plan.run(tvec![input.into()]).unwrap();
let mut tensor = outputs.pop().unwrap();
let tensor = tensor.to_array_view::<f32>().unwrap();
assert_eq!(tensor, ndarray::arr1(&[4.0, 5.5, 8.0]).into_dyn());
model | |
ops | |
tensor | |
tfpb | Generated protobuf codec for SharedTensor models, plus a handful of helper for
writting tests.
|