Skip to content
Discussion options

You must be logged in to vote

Actually, this problem can be solved using a lax.while_loop. The solution looks something like the following:

def body(carry):
   # Do something
   return carry + 1

cond_fun = lambda carry: .1 * carry <= 10.

lax.while_loop(cond_fun, body, 0)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mjhoover1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant