Trait custos_math::Gemm
source · [−]Expand description
Matrix multiplication. Uses provided device.
Example
use custos::{CPU, VecRead};
use custos_math::{Matrix, Gemm};
let device = CPU::new();
let a = Matrix::from((&device, (2, 3), [1., 2., 3., 4., 5., 6.,]));
let b = Matrix::from((&device, (3, 2), [6., 5., 4., 3., 2., 1.,]));
let c = device.gemm(&a, &b);
assert_eq!(device.read(c.as_buf()), vec![20., 14., 56., 41.,]);