Skip to main content

assert_array_same_shape

Function assert_array_same_shape 

Source
pub fn assert_array_same_shape<T, U>(
    actual: &Array<T>,
    desired: &Array<U>,
) -> Result<TestResult>
where T: Clone, U: Clone,
Expand description

Assert that arrays have the same shape

§Arguments

  • actual - The computed array
  • desired - The expected array

§Example

use numrs2::prelude::*;
use numrs2::testing::assert_array_same_shape;

let a: Array<f64> = Array::zeros(&[2, 3]);
let b: Array<f64> = Array::ones(&[2, 3]);

let result = assert_array_same_shape(&a, &b).expect("assert_array_same_shape failed");
assert!(result.passed);