Skip to content

Compilation when indices of vector depends on values stored in another vector (CSR matrix) #17474

Answered by jakevdp
dbalabka asked this question in Q&A
Discussion options

You must be logged in to vote

Your code is attempting to create a dynamically-shaped array. JAX does not support dynamically-shaped arrays (see JAX Sharp Bits: Dynamic Shapes).

I don't know the full logic of the code you're trying to write, but I would suggest trying to express your logic without creating the dynamic array. You already have the statically-shaped source array and the dynamic start and end indices: can you write your remaining code to operate directly on those, and avoid the need for a dynamically-shaped intermediate array?

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@dbalabka
Comment options

@jakevdp
Comment options

@dbalabka
Comment options

Answer selected by dbalabka
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