Open jacobusmmsmit opened 7 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
c982cde
) 81.53% compared to head (2571a16
) 81.53%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
TLDR:
This PR adds documentation to
@grad
that specifies what the@grad
ed function should return, and documents that any variables defined outside of the returned adjoint function have their valuesfrozen
to their compiled ones.Context:
In this discussion from issue #243 I fumbled my way through working out how
@grad
functions in relation tocompile
. Unsurprisingly to anyone who understands adjoints, I found out that any intermediate variables defined in the body of the function could be used but not updated when the gradient is compiled withcompile
.This PR is just a bit of documentation added to the unexported macro
@grad
so that anyone else who dives into ReverseDiff might have an easier time concretely understanding the expected effects ofcompile
.Any suggestions on changes to language or wording are more than welcome.