Open dvicini opened 2 weeks ago
Do you have thoughts on how you would like this to behave? (following the comment here)
I am honestly not quite sure, thinking about it some more, this seems quite tricky to solve robustly.
I am still trying to see how to best use the if-statements and am not sure yet what usage patterns will emerge.
Maybe it's more of a matter of putting a warning about this in the doc, if not there already
Separating this from issue #253
The following code silently produces a result value of 0, instead of 1 as it should. If I remove the if-statement, it works as expected. I tried adding dr.hint(..., exclude=[b]), but that produces an error RuntimeError: ad_traverse(): tried to forward-propagate derivatives across edge a1 -> a2, which lies outside of the current dr.isolate_grad() scope.
It's not entirely clear what's the right pattern is to get correct results here. I guess one option is to explicitly forward-propagate up to right before the if-conditioned is entered?