Skip to content

Respect MOI.AutomaticDifferentiationBackend() in NLP #292

@klamike

Description

@klamike

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions