Skip to content

Any reason for jax.lax.cond not playing nice with jacobian #17341

Answered by jakevdp
samskiter asked this question in General
Discussion options

You must be logged in to vote

# <--- would this qualify as the side-effect ?

Yes, definitely.

If you're updating attributes of self but not returning self from your function, then your function is impure and I would not expect JAX transformations to work with your code.

Replies: 3 comments 19 replies

Comment options

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

@jakevdp
Comment options

Comment options

You must be logged in to vote
17 replies
@jakevdp
Comment options

@samskiter
Comment options

@jakevdp
Comment options

Answer selected by samskiter
@samskiter
Comment options

@samskiter
Comment options

@samskiter
Comment options

@jakevdp
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants