Open DrTVockerodtMO opened 2 weeks ago
Thanks for reporting this Terry. @LonelyCat124 will the new DA you're working on enable us to look backwards and find the earliest point to which we could move the assignment k = 0
in this example?
It would be able to find the previous dependency to k (which in this case would either be the loop or the call inside the loop, maybe both) I think but you'd then have to do something with that information.
It would be able to find the previous dependency to k (which in this case would either be the loop or the call inside the loop, maybe both) I think but you'd then have to do something with that information.
Great - it was only the information I was after. We'd just have to modify the current code that moves the assignment all the way to the top.
I have a question for @DrTVockerodtMO: I thought we didn't support constructing the adjoint of code with Call
in it? Is that example code exactly what you're giving PSyAD?
I have a question for @DrTVockerodtMO: I thought we didn't support constructing the adjoint of code with
Call
in it? Is that example code exactly what you're giving PSyAD?
This is just a conceptual example, not fed to PSyAD.
Suppose we have some forward code of the form
When PSyAD generates the adjoint of this code, the
k
assignments are treated as passive, so they all precipitate up to the top which yieldsWhen it should be