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

Add ifelse #47

Open
mschauer opened this issue Nov 30, 2022 · 2 comments
Open

Add ifelse #47

mschauer opened this issue Nov 30, 2022 · 2 comments

Comments

@mschauer
Copy link
Collaborator

mschauer commented Nov 30, 2022

Essentially, ifelse(c, x, y) == [x, y][1 + !c]

@RickDW
Copy link

RickDW commented Feb 4, 2024

Hi, it's been a while since this was posted but I'm curious if there's any update on this. Is this going to be the way to implement stochastically differentiable if statements, or is there eventually going to be a way to use standard if ... end syntax?

@gaurav-arya
Copy link
Owner

Hey! Although I haven't gotten around to explicitly handling ifelse, there is a more powerful (experimental) StochasticAD.propagate function: see the branching example at https://gaurav-arya.github.io/StochasticAD.jl/stable/devdocs.html#via-StochasticAD.propagate

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

No branches or pull requests

3 participants