Skip to content

differentiable fori_loop ? #9699

Answered by jakevdp
wangleiphy asked this question in General
Discussion options

You must be logged in to vote

Thanks for the question! That part of the doc should be updated: while it's true that in general fori_loop is not reverse-mode differentiable, in the special case of concrete start and end-points, we lower fori_loop to scan to allow for reverse-mode differentiation. Here's where it happens in the source: https://github.com/google/jax/blob/d5a1c64d135ae8519c61e15a2f32a75d8de36ab3/jax/_src/lax/control_flow.py#L205-L217

Replies: 1 comment 1 reply

Comment options

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

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