@@ -17,7 +17,7 @@ using Core: Vararg
1717 end
1818end
1919
20- function inner_grad (mode:: Mode , θ, bθ, f, p) where Mode
20+ function inner_grad (mode:: Mode , θ, bθ, f, p) where { Mode}
2121 Enzyme. autodiff (mode,
2222 Const (firstapply),
2323 Active,
@@ -28,7 +28,7 @@ function inner_grad(mode::Mode, θ, bθ, f, p) where Mode
2828 return nothing
2929end
3030
31- function hv_f2_alloc (mode:: Mode , x, f, p) where Mode
31+ function hv_f2_alloc (mode:: Mode , x, f, p) where { Mode}
3232 dx = Enzyme. make_zero (x)
3333 Enzyme. autodiff (mode,
3434 Const (firstapply),
@@ -80,14 +80,15 @@ function lag_grad(mode, x, dx, lagrangian::Function, _f::Function, cons::Functio
8080 return nothing
8181end
8282
83-
84- set_runtime_activity2 (a:: Mode1 , :: Enzyme.Mode{ABI, Err, RTA} ) where {Mode1, ABI, Err, RTA} = Enzyme. set_runtime_activity (a, RTA)
83+ function set_runtime_activity2 (
84+ a:: Mode1 , :: Enzyme.Mode{ABI, Err, RTA} ) where {Mode1, ABI, Err, RTA}
85+ Enzyme. set_runtime_activity (a, RTA)
86+ end
8587function OptimizationBase. instantiate_function (f:: OptimizationFunction{true} , x,
8688 adtype:: AutoEnzyme , p, num_cons = 0 ;
8789 g = false , h = false , hv = false , fg = false , fgh = false ,
8890 cons_j = false , cons_vjp = false , cons_jvp = false , cons_h = false ,
8991 lag_h = false )
90-
9192 rmode = if adtype. mode isa Nothing
9293 Enzyme. Reverse
9394 else
@@ -97,7 +98,7 @@ function OptimizationBase.instantiate_function(f::OptimizationFunction{true}, x,
9798 fmode = if adtype. mode isa Nothing
9899 Enzyme. Forward
99100 else
100- set_runtime_activity2 (Enzyme. Forward. adtype. mode)
101+ set_runtime_activity2 (Enzyme. Forward. adtype. mode)
101102 end
102103
103104 if g == true && f. grad === nothing
0 commit comments