Using Awkward Arrays in Numba's jitclass
#2972
Replies: 4 comments
-
@ianna is this something that you'd be the person to ping for? :) |
Beta Was this translation helpful? Give feedback.
-
This is the sort of thing that @ianna can look into, but we haven't thought about what would happen if someone tries to use Awkward Arrays in The symptoms sound a lot like looking at uninitialized memory—to have something work with anything but 3 elements suspiciously sounds like the "working" cases are just lucky that nothing has overwritten that memory. If so, it's very unlikely that the "working" cases will continue to work on another computer or another operating system. Awkward Arrays in Numba are borrowed references—the Understanding what's happening here would involve understanding how Numba's |
Beta Was this translation helpful? Give feedback.
-
I see, it would explain it !
In the current version of the awkward library, it's not supposed to be used with |
Beta Was this translation helpful? Give feedback.
-
We need to have more comprehensive documentation on using Awkward Array in Numba, and that documentation would specify which Numba features are applicable and which are not. For now, though, I'll make this a Discussion, since it can act as a public service announcement to not use Awkward Arrays in |
Beta Was this translation helpful? Give feedback.
-
Version of Awkward Array
2.5.0
Description and code to reproduce
Context
In order to pass a ragged array in a class wrapped using
@jitclass
ofnumba
. I want to useak.Array
to store some information that will be used inside a method of the class.Example of usage
Issue
This code raises :
ValueError: slice index out of bounds
It seems like only the first call to
do_smth
can access toself.arr
, but the second call can't find anymore the values inself.arr
What's more surprising is that
arr
with more or less elements, it works ... It's only when there are exactly 3 elements that breaksx = np.zeros(4)
, it works as wellx = np.zeros(3)
, it works as well ...So, if anymore could help me to explain this bug and how to solve it 🥲
Beta Was this translation helpful? Give feedback.
All reactions