[][src]Function autograd::ops::matmul

pub fn matmul<T: Float, A: AsRef<Tensor<T>>, B: AsRef<Tensor<T>>>(
    a: A,
    b: B
) -> Tensor<T>

Matrix multiplication.

Both a and b must be 2-ranked tensors.

extern crate autograd as ag;

let ref a: ag::Tensor<f32> = ag::zeros(&[4, 2]);
let ref b: ag::Tensor<f32> = ag::zeros(&[2, 3]);
let ref c = ag::matmul(a, b);

assert_eq!(c.eval(&[]).unwrap().shape(), &[4, 3]);

This function supports only f32 and f64.