Function tract_linalg::generic
source · pub fn generic() -> Ops
Examples found in repository?
src/lib.rs (line 119)
118 119 120 121 122 123 124 125 126 127
pub fn best() -> Ops {
let mut ops = generic();
#[cfg(target_arch = "x86_64")]
x86_64_fma::plug(&mut ops);
#[cfg(any(target_arch = "arm", target_arch = "armv7"))]
arm32::plug(&mut ops);
#[cfg(target_arch = "aarch64")]
arm64::plug(&mut ops);
ops
}
More examples
Hide additional examples
src/frame/mmm/cost_model.rs (line 66)
62 63 64 65 66 67 68 69 70
pub fn predict(&self, m: usize, k: usize, n: usize) -> &str {
let mut x = self.features(m, k, n);
self.normalize(&mut x);
let mut hidden = Self::dnn(&x, self.w1, self.b1);
(crate::generic().tanh_f32)().run(&mut hidden).unwrap();
let output = Self::dnn(&hidden, self.w2, self.b2);
let ix = output.iter().copied().position_max_by(order_f).unwrap();
self.kernels[ix]
}