Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vmap support / batching rule for lax.cond #490

Closed
jonasrauber opened this issue Mar 10, 2019 · 2 comments · Fixed by #1238
Closed

vmap support / batching rule for lax.cond #490

jonasrauber opened this issue Mar 10, 2019 · 2 comments · Fixed by #1238
Labels
enhancement New feature or request

Comments

@jonasrauber
Copy link
Contributor

It would be great to have vmap support for lax.cond similar to the recently added vmap support for lax.while_loop. I know that I can use np.where as a workaround for some cases, but for computationally expensive if conditions a batched cond might be better.

@jonasrauber
Copy link
Contributor Author

jonasrauber commented Mar 10, 2019

As I usually only need the if condition (no else part) I am considering a single iteration while_loop instead of cond as another workaround. What do you think?

@mattjj
Copy link
Member

mattjj commented Mar 10, 2019

I think this feature sounds super fun to implement and I can't wait to try it!

But in the meantime a single-iteration while_loop (or `fori_loop if it's more convenient) is probably a good workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants