We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2f6579f commit f09a1bbCopy full SHA for f09a1bb
1 file changed
src/ArrayDiff.jl
@@ -56,8 +56,13 @@ include("evaluator.jl")
56
include("array_nonlinear_function.jl")
57
include("parse_moi.jl")
58
59
-# Tell MOI to create an ArrayDiff.Model when Mode() is the AD backend.
60
-Nonlinear.model(::Mode) = Model()
+if isdefined(Nonlinear, :model)
+ # Needs https://github.com/jump-dev/MathOptInterface.jl/pull/2989
61
+ # Remove this `if` when it's part of a released version of MOI
62
+
63
+ # Tell MOI to create an ArrayDiff.Model when Mode() is the AD backend.
64
+ Nonlinear.model(::Mode) = Model()
65
+end
66
67
# Extend MOI.Nonlinear.set_objective so that solvers calling
68
# MOI.Nonlinear.set_objective(arraydiff_model, snf) dispatch here.
0 commit comments