Skip to content
Discussion options

You must be logged in to vote

I managed to determine the cause of the issue - when JAX is checking the return type of a callback, it tries to compare shapes - but a float doesn't have a shape attribute. So the fix was to wrap jnp.array to my returned value inside a proxy call to rootFinder. After doing this, scan works just fine and I can even wrap the entire call in a while_loop and the performance is almost identical to the list comprehension solution I was using.

Thanks for the assistance regarding vmap vs scan @anh-tong !

Replies: 3 comments 2 replies

Comment options

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

Comment options

You must be logged in to vote
0 replies
Answer selected by jackbashford
Comment options

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

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