We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 24f8d59 commit fc1baceCopy full SHA for fc1bace
1 file changed
ndarray-rand/src/lib.rs
@@ -86,9 +86,7 @@ impl<S, D> RandomExt<S, D> for ArrayBase<S, D>
86
R: Rng,
87
Sh: ShapeBuilder<Dim=D>,
88
{
89
- let shape = shape.into_shape();
90
- let elements = Vec::from_iter((0..shape.size()).map(move |_| dist.ind_sample(rng)));
91
- Self::from_shape_vec(shape, elements).unwrap()
+ Self::from_shape_fn(shape, |_| dist.ind_sample(rng))
92
}
93
94
0 commit comments