You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a list of numpy arrays, where each array is of different length. The typical numpy method in the past has been to set their datatypes to object and allow ragged arrays.
Since I have ~100,000 arrays, and each thread gets 1 array, it's not feasible to pass all as arguments to the kernel.
Ideally I would just send the list and index them as needed. I could create a flat array, separately pass the corresponding indices for array starts/ends, seemingly mirroring a list of pointers with some extra leg-work.
Perhaps I can pad the arrays and then construct a BSR to help get rid of the padding.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a list of numpy arrays, where each array is of different length. The typical numpy method in the past has been to set their datatypes to object and allow ragged arrays.
Since I have ~100,000 arrays, and each thread gets 1 array, it's not feasible to pass all as arguments to the kernel.
Ideally I would just send the list and index them as needed. I could create a flat array, separately pass the corresponding indices for array starts/ends, seemingly mirroring a list of pointers with some extra leg-work.
Perhaps I can pad the arrays and then construct a BSR to help get rid of the padding.
Are there better/built-in ways?
Beta Was this translation helpful? Give feedback.
All reactions