Skip to content

Commit 707ab59

Browse files
committed
Fix
1 parent 84f6ded commit 707ab59

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Nonlinear/ReverseAD/mathoptinterface_api.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ function MOI.initialize(d::NLPEvaluator, requested_features::Vector{Symbol})
139139
# 10 is hardcoded upper bound to avoid excess memory allocation
140140
max_chunk = min(max_chunk, 10)
141141
max_expr_with_sub_length =
142-
maximum(d.subexpressions; init = max_expr_length) do subexpr
143-
return length(subexpr.nodes)
142+
maximum(d.subexpression_order; init = max_expr_length) do k
143+
return length(d.subexpressions[k].nodes)
144144
end
145145
if d.want_hess || want_hess_storage
146146
d.input_ϵ = zeros(max_chunk * N)

0 commit comments

Comments
 (0)