Open
Description
The DiffResults documentation clearly states that whenever a DiffResult
object is used, it must be realiased at the end of the function call:
result = do_stuff!(result, args...)
See for instance the docstrings in https://juliadiff.org/DiffResults.jl/stable/#Mutating-a-DiffResult, or the issue DiffResults#17
This is not done by ReverseDiff, for instance here:
ReverseDiff.jl/src/api/gradients.jl
Lines 21 to 27 in c982cde
Am I right in deducing that it can lead to incorrectness?