Skip to content

Commit

Permalink
fix: __value_derivative removal from line searches
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Sep 27, 2024
1 parent 25efa16 commit be0f8da
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/globalization/line_search.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ function __internal_init(
@warn "Scalar AD is supported only for AutoForwardDiff and AutoFiniteDiff. \
Detected $(autodiff). Falling back to AutoFiniteDiff."
end
deriv_op = @closure (du, u, fu, p) -> last(__value_derivative(
autodiff, Base.Fix2(f, p), u)) *
fu *
du
deriv_op = @closure (du, u, fu, p) -> begin
# Temporary solution, we are anyways moving to LineSearch.jl
return DI.derivative(f, autodiff, u, Constant(p)) * fu * du
end
else
# Both forward and reverse AD can be used for line-search.
# We prefer forward AD for better performance, however, reverse AD is also supported if user explicitly requests it.
Expand Down

0 comments on commit be0f8da

Please sign in to comment.