Document Enzyme.Compiler.recursive_accumulate#1894
Document Enzyme.Compiler.recursive_accumulate#1894gdalle wants to merge 1 commit intoEnzymeAD:mainfrom
Enzyme.Compiler.recursive_accumulate#1894Conversation
|
This is very much an internal function subject to change at any point. |
|
Is there an alternative that might be more flexible? |
|
not offhand (which you're welcome to use this right now with the forewarning that this is an internal function whose semantics are subject to change). Thus a patch may chance its semantics and/or arguments (e.g. per #1852) |
|
But regardless of the changes in semantics, it will always be the precise function I need to recursively accumulate into a shadow, right? |
|
....kind of. At the moment the semantics are such that it does y .+= f(x) for the non mutable internal states. e.g. presently this works for a Vector{Float64} and Vector{Tuple{Float64, Float64}} however it will not recursively add the inner types of Vector{Vector{Float64}} |
|
PSA I'm working on improving |
|
I also think these functions should be internal and that the public interface for rule writing and DI's use cases should be a |
|
Lol, didn't see that @wsmoses already linked to the PR, oh well, hope you enjoyed the elevator pitch |
|
Yeah I concur @danielwe . The only reason that QuadGK gets away with using this atm is the fact that I wrote that extension and commit to maintaining it (as we migrate to a public style interface) |
|
@danielwe I actually did enjoy the elevator pitch, and I would love a public API that behaves like a vector space. Feel free to ping me when this emerges! |
|
Closing this per above discussion |
Adds a docstring for
Enzyme.Compiler.recursive_accumulateand displays that docstring in the API reference.I assume we should do the same for
recursive_addbut I don't exactly understand what it does.This is needed in DifferentiationInterface for accumulating into the shadow between forward and reverse pass in
autodiff_thunk.