Function autograd::ops::matmul_t
[−]
[src]
pub fn matmul_t(
a: &Tensor,
b: &Tensor,
transpose_a: bool,
transpose_b: bool
) -> Tensor
Matrix multiplication with inputs's transposition.
Similar specification as matmul
but, if transpose_a
is true, a
is transposed
before actual matrix multiplication. It is the same for transpose_b
.
The performance is better than explicitly computing like ag::matmul(ag::transpose)
.
extern crate autograd as ag; let mut ctx = ag::Context::new(); let ref a = ag::zeros(&[2, 4]); let ref b = ag::zeros(&[2, 3]); let ref c = ag::matmul_t(a, b, true, false); assert_eq!(c.eval(&mut ctx).shape(), &[4, 3]);