Skip to content

Best way to operate upon innermost dimension #902

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

You must be logged in to vote

Here's another approach (you mentioned Numba in Gitter). You can write a Numba function that doesn't care how many levels deep an array is, as long as it can resolve that depth during compilation. I just got help on this on the numba/numba-dev Gitter (thanks, @seibert!), since my attempt to do it using nb.generated_jit ran into an unimplemented feature. The reason for using nb.generated_jit instead of nb.jit is that you get to write type-dependent Python code that only runs at compile-time—basically, like template metaprogramming in C++, but with a much easier language to do that in (Python).

The nb.generated_jit approach raises NotImplementedError when you construct a recursion on types,…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@agoose77
Comment options

agoose77 Jun 9, 2021
Collaborator Author

Comment options

You must be logged in to vote
4 replies
@agoose77
Comment options

agoose77 Jun 8, 2021
Collaborator Author

@agoose77
Comment options

agoose77 Jun 9, 2021
Collaborator Author

@jpivarski
Comment options

@agoose77
Comment options

agoose77 Jun 9, 2021
Collaborator Author

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