tract-core 0.2.0

Tiny, no-nonsense, self contained, TensorFlow and ONNX inference
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::optim;

pub trait Context: std::fmt::Debug + Send + Sync {
    fn optimizer_passes(&self) -> Vec<Box<optim::OptimizerPass>>;
}

#[derive(Debug)]
pub struct DefaultContext;

impl Context for DefaultContext {
    fn optimizer_passes(&self) -> Vec<Box<optim::OptimizerPass>> {
        let mut passes = optim::normalization();
        passes.extend(optim::codegen().into_iter());
        passes
    }
}