Function matvec
pub fn matvec<B, const DM: usize, const DV: usize, K>(
matrix: Tensor<B, DM, K>,
vector: Tensor<B, DV, K>,
) -> Tensor<B, DV, K>Expand description
Performs matrix-vector multiplication with optional batch dimensions.
The matrix tensor is expected to have rank DM with the last two dimensions representing
the matrix rows and columns. The vector tensor should have rank DV = DM - 1, sharing
broadcast-compatible batch dimensions and matching the last dimension of the matrix.
§Panics
- If the matrix rank is lower than 2.
- If the vector rank isn’t one less than the matrix rank.
- If batch dimensions differ between the operands.
- If the inner dimensions are incompatible for multiplication.