File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,13 @@ An abstract type for extending [`Evaluator`](@ref).
184184"""
185185abstract type AbstractAutomaticDifferentiation end
186186
187+ function MOI. Utilities. map_indices (
188+ :: F ,
189+ backend:: AbstractAutomaticDifferentiation ,
190+ ) where {F<: Function }
191+ return backend
192+ end
193+
187194"""
188195 Evaluator(
189196 model::Model,
Original file line number Diff line number Diff line change @@ -1147,6 +1147,22 @@ function test_unsupported_features_expr_graph_only()
11471147 return
11481148end
11491149
1150+ function test_automatic_differentiation_backend ()
1151+ inner = MOI. Utilities. UniversalFallback (MOI. Utilities. Model {Float64} ())
1152+ model = MOI. Utilities. CachingOptimizer (
1153+ MOI. Utilities. UniversalFallback (MOI. Utilities. Model {Float64} ()),
1154+ MOI. Utilities. MockOptimizer (inner),
1155+ )
1156+ MOI. set (
1157+ model,
1158+ MOI. AutomaticDifferentiationBackend (),
1159+ MOI. Nonlinear. ExprGraphOnly (),
1160+ )
1161+ @test MOI. get (inner, MOI. AutomaticDifferentiationBackend ()) ==
1162+ MOI. Nonlinear. ExprGraphOnly ()
1163+ return
1164+ end
1165+
11501166end # TestNonlinear
11511167
11521168TestNonlinear. runtests ()
You can’t perform that action at this time.
0 commit comments