Skip to content

Commit adac560

Browse files
committed
fix: __value_derivative removal from line searches
1 parent 3f59f49 commit adac560

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/globalization/line_search.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ function __internal_init(
110110
@warn "Scalar AD is supported only for AutoForwardDiff and AutoFiniteDiff. \
111111
Detected $(autodiff). Falling back to AutoFiniteDiff."
112112
end
113-
deriv_op = @closure (du, u, fu, p) -> last(__value_derivative(
114-
autodiff, Base.Fix2(f, p), u)) *
115-
fu *
116-
du
113+
deriv_op = @closure (du, u, fu, p) -> begin
114+
# Temporary solution, we are anyways moving to LineSearch.jl
115+
return DI.derivative(f, autodiff, u, Constant(p)) * fu * du
116+
end
117117
else
118118
# Both forward and reverse AD can be used for line-search.
119119
# We prefer forward AD for better performance, however, reverse AD is also supported if user explicitly requests it.

0 commit comments

Comments
 (0)