We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3ab67eb commit ee97dbfCopy full SHA for ee97dbf
1 file changed
tests/par_zip.rs
@@ -97,6 +97,28 @@ fn test_zip_collect() {
97
assert_abs_diff_eq!(a, &b + &c, epsilon = 1e-6);
98
assert_eq!(a.strides(), b.strides());
99
}
100
+
101
+}
102
103
+#[test]
104
+#[cfg(feature = "approx")]
105
+fn test_zip_small_collect() {
106
+ use approx::assert_abs_diff_eq;
107
108
+ for m in 0..32 {
109
+ for n in 0..16 {
110
+ let dim = (m, n);
111
+ let b = Array::from_shape_fn(dim, |(i, j)| 1. / (i + 2 * j + 1) as f32);
112
+ let c = Array::from_shape_fn(dim, |(i, j)| f32::ln((1 + i + j) as f32));
113
114
+ {
115
+ let a = Zip::from(&b).and(&c).par_apply_collect(|x, y| x + y);
116
117
+ assert_abs_diff_eq!(a, &b + &c, epsilon = 1e-6);
118
+ assert_eq!(a.strides(), b.strides());
119
+ }
120
121
122
123
124
#[test]
0 commit comments