EnzymeAD / Enzyme.jl

Julia bindings for the Enzyme automatic differentiator
https://enzyme.mit.edu
MIT License
456 stars 64 forks source link

What is the use of `DuplicatedNoNeed` now that `ReturnPrimal` is in the mode? #1892

Closed gdalle closed 1 month ago

gdalle commented 1 month ago

Is it just redundant information? If so, which one takes precedence?

wsmoses commented 1 month ago

See docs https://enzyme.mit.edu/julia/stable/api/#EnzymeCore.DuplicatedNoNeed it now exclusively is for arguments.

gdalle commented 1 month ago

Thanks for the pointer but the docstring is still unclear to me. What would be the purpose of a variable to which we write but from which we never read again?

wsmoses commented 1 month ago

this help? https://github.com/EnzymeAD/Enzyme.jl/pull/1904