Skip to content

Commit 7af93cf

Browse files
Incorrect convert call for cons_hess_prototype since it's a vector of matrices
1 parent 094cb8c commit 7af93cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/function/function.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function instantiate_function(f, x, ::AbstractADType, p, num_cons = 0)
5252
cons_h = f.cons_h === nothing ? nothing : (res,x)->f.cons_h(res,x,p)
5353
hess_prototype = f.hess_prototype === nothing ? nothing : convert.(eltype(x), f.hess_prototype)
5454
cons_jac_prototype = f.cons_jac_prototype === nothing ? nothing : convert.(eltype(x), f.cons_jac_prototype)
55-
cons_hess_prototype = f.cons_hess_prototype === nothing ? nothing : convert.(eltype(x), f.cons_hess_prototype)
55+
cons_hess_prototype = f.cons_hess_prototype === nothing ? nothing : [convert.(eltype(x), f.cons_hess_prototype[i]) for i in 1:num_cons]
5656
expr = symbolify(f.expr)
5757
cons_expr = symbolify.(f.cons_expr)
5858

0 commit comments

Comments
 (0)