Skip to main content

linear

Function linear 

Source
pub fn linear(
    x: &[f32],
    m: usize,
    k: usize,
    w: &[f32],
    n: usize,
    b: Option<&[f32]>,
    y: &mut [f32],
    threads: usize,
)
Expand description

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.

§Panics

If a length does not match the shape.