pub fn linear( x: &[f32], m: usize, k: usize, w: &[f32], n: usize, b: Option<&[f32]>, y: &mut [f32], threads: usize, )
y = x wᵀ + b with x as [m, k], w as [n, k], b as [n] and y as [m, n]. This packs w on every call, so a caller with a fixed weight should pack it once and run a Gemm.
y = x wᵀ + b
x
[m, k]
w
[n, k]
b
[n]
y
[m, n]
pack
Gemm
If a length does not match the shape.