Function dfdx::tensor_ops::vecmat_mul
source · [−]pub fn vecmat_mul<const K: usize, const N: usize, TAPE: Tape>(
lhs: Tensor1D<K, TAPE>,
rhs: &Tensor2D<K, N, NoneTape>
) -> Tensor1D<N, TAPE>
Expand description
vector * matrix multiplication.
This is equivalent to matrix multiplication with M == 1.
Generics
K
: number of columns oflhs
and number of rows ofrhs
.N
: Number of columns ofrhs
.
Arguments
lhs
- a 1d tensor representing a 1xK matrixrhs
- a 2d tensor representing a KxN matrix
Returns a 1d tensor representing an 1xN matrix.
Examples
let x: Tensor1D<2> = Tensor1D::zeros();
let y: Tensor2D<2, 4> = Tensor2D::zeros();
let result: Tensor1D<4> = vecmat_mul(x, &y);