The current code has SparseReverseMode hard-coded:
|
""" |
|
_create_evaluator(form::Form) |
|
|
|
Create the evaluator for the NLP. |
|
""" |
|
function _create_evaluator(form::Form) |
|
nlp = form.model |
|
backend = MOI.Nonlinear.SparseReverseMode() |
|
evaluator = MOI.Nonlinear.Evaluator( |
|
nlp, |
|
backend, |
|
MOI.VariableIndex.(1:form.num_variables), |
|
) |
|
MOI.initialize(evaluator, [:Hess, :Jac]) |
|
return evaluator |
|
end |
Perhaps backend should be set based on MOI.AutomaticDifferentiationBackend()? Besides the SymbolicMode, it would also allow to use DiffOpt with custom evaluators.