Generating arrays of different shapes can be 1000 time slower than numpy, is there a better way to do it? #6847
Unanswered
morgangiraud
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone, thanks for the work done on JAX, I've been quite pleased so far with the performance of the lib. Now I'm running into a problem for which I can't find a good way to do it.
I'm trying to create a high number of arrays for which their shape are generated randomly. I understand that JAX add overheads to this kind of small operation but is there a way to generate those arrays efficiently?
Here is the code I've been using:
Outputs:
Note: The end goal is to
pad
those arrays and thenvstack
them into one big array of ones and zeros (The important part is to keep those rectangles of ones)Beta Was this translation helpful? Give feedback.
All reactions