Skip to content

Array shape effects numba compilation #2197

Answered by agoose77
Durman asked this question in Q&A
Discussion options

You must be logged in to vote

Regular dimensions in Awkward (if your type has ... * N * ..., you have a regular dimension) include the shape information in their type. I believe that Numba does this differently for native NumPy arrays; the shape metadata is runtime-only. We have discussed this here before, and the decision at the time was "this is a compromise": #1343

In this case, your np.newaxis inserts a new regular axis at axis=0, meaning that your innermost shape changes with the list length. If you make that extra dimension ragged, e.g. with ak.from_regular(..., axis=...), then you will end up with an array whose Numba type (you can see this via array.numba_type` ) does not change with its length.

In general, th…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jpivarski
Comment options

@Durman
Comment options

Answer selected by Durman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants