Skip to content

Commit

Permalink
add a test for zipping axis_windows with a 1d array
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasBoss authored and bluss committed Aug 1, 2024
1 parent 4c26e16 commit cf95ef9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,22 @@ fn test_axis_windows_3d()
]);
}

#[test]
fn tests_axis_windows_3d_zips_with_1d()
{
let a = Array::from_iter(0..27)
.into_shape_with_order((3, 3, 3))
.unwrap();
let mut b = Array::zeros(2);

Zip::from(b.view_mut())
.and(a.axis_windows(Axis(1), 2))
.for_each(|b, a| {
*b = a.sum();
});
assert_eq!(b,arr1(&[207, 261]));
}

#[test]
fn test_window_neg_stride()
{
Expand Down

0 comments on commit cf95ef9

Please sign in to comment.