Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Commit c8418c2

Browse files
Merge pull request #49 from SciML/Vaibhavdixit02-patch-1
Fix OOP ForwardDiff.jl wrapper
2 parents ba54a1f + b00a57b commit c8418c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/OptimizationForwardDiffExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ function OptimizationBase.instantiate_function(f::OptimizationFunction{false},
256256

257257
_f = (θ, args...) -> first(f.f(θ, cache.p, args...))
258258
p = cache.p
259-
259+
x = cache.u0
260260
if f.grad === nothing
261261
gradcfg = ForwardDiff.GradientConfig(_f, x, ForwardDiff.Chunk{chunksize}())
262262
grad = (θ, args...) -> ForwardDiff.gradient(x -> _f(x, args...), θ,

0 commit comments

Comments
 (0)