DiffOpt.jl
DiffOpt.jl copied to clipboard
Respect `MOI.AutomaticDifferentiationBackend()` in NLP
The current code has SparseReverseMode hard-coded:
https://github.com/jump-dev/DiffOpt.jl/blob/bf2c4c389ecd6ae63356e292b74a632b0517fa68/src/NonLinearProgram/nlp_utilities.jl#L94-L109
Perhaps backend should be set based on MOI.AutomaticDifferentiationBackend()? Besides the SymbolicMode, it would also allow to use DiffOpt with custom evaluators.
We do need an attribute for setting that.
We could use MOI.AutomaticDifferentiationBackend by default. We could have a different attribute in case the user wants a different AD than the solver but using the same as the solver to start with would be a good first step