@@ -19,6 +19,7 @@ function Optimization.instantiate_function(f::OptimizationFunction{true}, x,
19
19
res .= zero (eltype (res))
20
20
Enzyme. autodiff (Enzyme. Reverse,
21
21
Const (firstapply),
22
+ Active,
22
23
Const (f. f),
23
24
Enzyme. Duplicated (θ, res),
24
25
Const (p),
@@ -32,6 +33,7 @@ function Optimization.instantiate_function(f::OptimizationFunction{true}, x,
32
33
function g (θ, bθ, f, p, args... )
33
34
Enzyme. autodiff_deferred (Enzyme. Reverse,
34
35
Const (firstapply),
36
+ Active,
35
37
Const (f),
36
38
Enzyme. Duplicated (θ, bθ),
37
39
Const (p),
@@ -65,6 +67,7 @@ function Optimization.instantiate_function(f::OptimizationFunction{true}, x,
65
67
dx = zeros (length (x))
66
68
Enzyme. autodiff_deferred (Enzyme. Reverse,
67
69
firstapply,
70
+ Active,
68
71
f,
69
72
Enzyme. Duplicated (x, dx),
70
73
Const (p),
@@ -155,6 +158,7 @@ function Optimization.instantiate_function(f::OptimizationFunction{true},
155
158
res .= zero (eltype (res))
156
159
Enzyme. autodiff (Enzyme. Reverse,
157
160
Const (firstapply),
161
+ Active,
158
162
Const (f. f),
159
163
Enzyme. Duplicated (θ, res),
160
164
Const (p),
@@ -197,7 +201,7 @@ function Optimization.instantiate_function(f::OptimizationFunction{true},
197
201
if f. hv === nothing
198
202
function f2 (x, f, p, args... )
199
203
dx = zeros (length (x))
200
- Enzyme. autodiff_deferred (Enzyme. Reverse, firstapply,
204
+ Enzyme. autodiff_deferred (Enzyme. Reverse, firstapply, Active,
201
205
f,
202
206
Enzyme. Duplicated (x, dx),
203
207
Const (p),
0 commit comments