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

pub fn matmul(a: &Tensor, b: &Tensor) -> Tensor

Matrix multiplication.

Both a and b must be 2-ranked tensors.

extern crate autograd as ag;

let mut ctx = ag::Context::new();

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

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