/* Appellation: tensor Contrib: FL03 */ #![cfg(test)] extern crate ndtensor; use ndarray::Ix2; use ndtensor::prelude::Tensor; #[test] fn test_addition() { let shape = (3, 3); let a = Tensor::::linshape(shape.clone()).unwrap(); let b = Tensor::::ones(shape); let res = a.add(&b); assert_eq!(res.data().sum(), 45f64); }