-
Hello! i'm currently creating image array dim of (1, 3, x, y) doing something like this.
i'm refactoring iteration and map using rayon feature right now and would love to do that for this ndarray creation step as well. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
No, not to my knowledge. What you could do is
|
Beta Was this translation helpful? Give feedback.
-
Zip is for iteration and parallel iteration, and it allows creating arrays. Maybe you could use Zip needs some input to map, you can use indices or a no-allocation array for that? Zip::from(ndarray::indices((1, 3, size.width as usize, size.height as usize)))
.par_map_collect(|(i, j, k)| ...) |
Beta Was this translation helpful? Give feedback.
Zip is for iteration and parallel iteration, and it allows creating arrays.
Maybe you could use
Zip
and.par_map_collect()
to create the array.It will only make sense if the element creating computation is heavy enough. Otherwise it will just be overhead and no gain from using rayon.
Zip needs some input to map, you can use indices or a no-allocation array for that?