Closed
Description
At the moment the only viable way I see is to support one active and one inactive argument, and leave it to ComponentArrays to combine several arguments if necessary. It could be done by passing a tuple (x, c) instead of the input x. @wsmoses do you think that might get us 90% of the way to where we need to be?
See the following discussions:
- Enzyme hessian with closure: "You may be using a constant variable as temporary storage for active memory" #307
- Support for inactive arguments in DifferentiationInterface LuxDL/Lux.jl#685
- [WIP] Fresh attempt at DI integration SciML/OptimizationBase.jl#54
- Switch to DifferentiationInterface tpapp/LogDensityProblemsAD.jl#29