@@ -28,7 +28,7 @@ function OptimizationBase.instantiate_function(f::OptimizationFunction{true}, x,
28
28
Const (f. f),
29
29
Enzyme. Duplicated (θ, res),
30
30
Const (p),
31
- args... )
31
+ Const .( args) ... )
32
32
end
33
33
end
34
34
else
@@ -43,7 +43,7 @@ function OptimizationBase.instantiate_function(f::OptimizationFunction{true}, x,
43
43
Const (f),
44
44
Enzyme. Duplicated (θ, bθ),
45
45
Const (p),
46
- args... ),
46
+ Const .( args) ... ),
47
47
return nothing
48
48
end
49
49
function hess (res, θ, args... )
@@ -77,13 +77,13 @@ function OptimizationBase.instantiate_function(f::OptimizationFunction{true}, x,
77
77
f,
78
78
Enzyme. Duplicated (x, dx),
79
79
Const (p),
80
- args... )
80
+ Const .( args) ... )
81
81
return dx
82
82
end
83
83
hv = function (H, θ, v, args... )
84
84
H .= Enzyme. autodiff (Enzyme. Forward, f2, DuplicatedNoNeed, Duplicated (θ, v),
85
85
Const (_f), Const (f. f), Const (p),
86
- args... )[1 ]
86
+ Const .( args) ... )[1 ]
87
87
end
88
88
else
89
89
hv = f. hv
@@ -168,7 +168,7 @@ function OptimizationBase.instantiate_function(f::OptimizationFunction{true},
168
168
Const (f. f),
169
169
Enzyme. Duplicated (θ, res),
170
170
Const (p),
171
- args... )
171
+ Const .( args) ... )
172
172
end
173
173
else
174
174
grad = (G, θ, args... ) -> f. grad (G, θ, p, args... )
@@ -179,7 +179,7 @@ function OptimizationBase.instantiate_function(f::OptimizationFunction{true},
179
179
Enzyme. autodiff_deferred (Enzyme. Reverse, Const (firstapply), Active, Const (f),
180
180
Enzyme. Duplicated (θ, bθ),
181
181
Const (p),
182
- args... )
182
+ Const .( args) ... )
183
183
return nothing
184
184
end
185
185
function hess (res, θ, args... )
@@ -194,7 +194,7 @@ function OptimizationBase.instantiate_function(f::OptimizationFunction{true},
194
194
Enzyme. BatchDuplicated (bθ, vdbθ),
195
195
Const (f. f),
196
196
Const (p),
197
- args... )
197
+ Const .( args) ... )
198
198
199
199
for i in eachindex (θ)
200
200
res[i, :] .= vdbθ[i]
@@ -211,13 +211,13 @@ function OptimizationBase.instantiate_function(f::OptimizationFunction{true},
211
211
f,
212
212
Enzyme. Duplicated (x, dx),
213
213
Const (p),
214
- args... )
214
+ Const .( args) ... )
215
215
return dx
216
216
end
217
217
hv = function (H, θ, v, args... )
218
218
H .= Enzyme. autodiff (Enzyme. Forward, f2, DuplicatedNoNeed, Duplicated (θ, v),
219
219
Const (f. f), Const (p),
220
- args... )[1 ]
220
+ Const .( args) ... )[1 ]
221
221
end
222
222
else
223
223
hv = f. hv
@@ -285,7 +285,7 @@ function OptimizationBase.instantiate_function(f::OptimizationFunction{false}, x
285
285
Const (f. f),
286
286
Enzyme. Duplicated (θ, res),
287
287
Const (p),
288
- args... )
288
+ Const .( args) ... )
289
289
return res
290
290
end
291
291
end
@@ -301,7 +301,7 @@ function OptimizationBase.instantiate_function(f::OptimizationFunction{false}, x
301
301
Const (f),
302
302
Enzyme. Duplicated (θ, bθ),
303
303
Const (p),
304
- args... ),
304
+ Const .( args) ... ),
305
305
return nothing
306
306
end
307
307
function hess (θ, args... )
@@ -316,7 +316,7 @@ function OptimizationBase.instantiate_function(f::OptimizationFunction{false}, x
316
316
Enzyme. BatchDuplicated (bθ, vdbθ),
317
317
Const (f. f),
318
318
Const (p),
319
- args... )
319
+ Const .( args) ... )
320
320
321
321
reduce (vcat, [reshape (vdbθ[i], (1 , length (vdbθ[i]))) for i in eachindex (θ)])
322
322
end
@@ -334,13 +334,13 @@ function OptimizationBase.instantiate_function(f::OptimizationFunction{false}, x
334
334
f,
335
335
Enzyme. Duplicated (x, dx),
336
336
Const (p),
337
- args... )
337
+ Const .( args) ... )
338
338
return dx
339
339
end
340
340
hv = function (θ, v, args... )
341
341
Enzyme. autodiff (Enzyme. Forward, f2, DuplicatedNoNeed, Duplicated (θ, v),
342
342
Const (_f), Const (f. f), Const (p),
343
- args... )[1 ]
343
+ Const .( args) ... )[1 ]
344
344
end
345
345
else
346
346
hv = f. hv
@@ -425,7 +425,7 @@ function OptimizationBase.instantiate_function(f::OptimizationFunction{false},
425
425
Const (f. f),
426
426
Enzyme. Duplicated (θ, res),
427
427
Const (p),
428
- args... )
428
+ Const .( args) ... )
429
429
return res
430
430
end
431
431
end
@@ -441,7 +441,7 @@ function OptimizationBase.instantiate_function(f::OptimizationFunction{false},
441
441
Const (f),
442
442
Enzyme. Duplicated (θ, bθ),
443
443
Const (p),
444
- args... ),
444
+ Const .( args) ... ),
445
445
return nothing
446
446
end
447
447
function hess (θ, args... )
@@ -456,7 +456,7 @@ function OptimizationBase.instantiate_function(f::OptimizationFunction{false},
456
456
Enzyme. BatchDuplicated (bθ, vdbθ),
457
457
Const (f. f),
458
458
Const (p),
459
- args... )
459
+ Const .( args) ... )
460
460
461
461
reduce (vcat, [reshape (vdbθ[i], (1 , length (vdbθ[i]))) for i in eachindex (θ)])
462
462
end
@@ -474,13 +474,13 @@ function OptimizationBase.instantiate_function(f::OptimizationFunction{false},
474
474
f,
475
475
Enzyme. Duplicated (x, dx),
476
476
Const (p),
477
- args... )
477
+ Const .( args) ... )
478
478
return dx
479
479
end
480
480
hv = function (θ, v, args... )
481
481
Enzyme. autodiff (Enzyme. Forward, f2, DuplicatedNoNeed, Duplicated (θ, v),
482
482
Const (_f), Const (f. f), Const (p),
483
- args... )[1 ]
483
+ Const .( args) ... )[1 ]
484
484
end
485
485
else
486
486
hv = f. hv
0 commit comments