StochasticAD.jl
StochasticAD.jl copied to clipboard
Add `ifelse`
Essentially, ifelse(c, x, y) == [x, y][1 + !c]
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?
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