Skip to content

Commit 01f637f

Browse files
Pass cons_hess_prototype and cons_jac_prototype from user's OptimizationFunction in the created OF in AutoForwardDiff
1 parent f7f9a3f commit 01f637f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/function/forwarddiff.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ function instantiate_function(f::OptimizationFunction{true}, x, adtype::AutoForw
9696
else
9797
cons_h = f.cons_h
9898
end
99-
99+
100100
return OptimizationFunction{true}(f.f, adtype; grad=grad, hess=hess, hv=hv,
101101
cons=cons, cons_j=cons_j, cons_h=cons_h,
102-
hess_prototype=nothing, cons_jac_prototype=nothing, cons_hess_prototype=nothing)
102+
hess_prototype=nothing, cons_jac_prototype=f.cons_jac_prototype, cons_hess_prototype=f.cons_hess_prototype)
103103
end

0 commit comments

Comments
 (0)