use matten::Tensor;
fn main() {
let a = Tensor::new(vec![1.0, 2.0, 3.0, 4.0], &[2, 2]);
let b = Tensor::new(vec![5.0, 6.0, 7.0, 8.0], &[2, 2]);
let c = a.matmul(&b);
println!("A = {a:?}");
println!("B = {b:?}");
println!("A × B = {c:?}"); assert_eq!(c.as_slice(), &[19.0, 22.0, 43.0, 50.0]);
let x = Tensor::new(vec![1.0, 2.0, 3.0, 4.0, 5.0, 6.0], &[2, 3]);
let y = Tensor::new((1..=12).map(|v| v as f64).collect(), &[3, 4]);
let z = x.matmul(&y);
println!("X × Y shape = {:?}", z.shape());
println!("Matrix multiplication: OK");
}