Skip to content

Creating computational graph using an array Bools #21869

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

You must be logged in to vote

There is no avoiding the tracing of all branches if you want to JIT-compile your branching logic.

If you use lax.switch and don't use vmap, then only one branch will be executed at runtime. But if tracing only a single branch is your concern, then you have to do the branching outside JIT.

Replies: 1 comment 1 reply

Comment options

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

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