Skip to main content

linear

Function linear 

Source
pub fn linear(x: &Tensor, w: &Tensor, b: Option<&Tensor>) -> Result<Tensor>
Expand description

y = x @ w^T + b, flattening any leading dims of x into a batch dim so this works for rank-2 or higher inputs against a rank-2 weight [d_out, d_in].