|
1 | | -import Optimization |
| 1 | +import Optimization, ADTypes |
2 | 2 | using ReverseDiff, Enzyme, BenchmarkTools, Test |
3 | 3 |
|
4 | 4 | lookup_pg = Dict(5 => 11, 4 => 13, 2 => 15, 3 => 17, 1 => 19) |
@@ -26,7 +26,7 @@ opf_objective = let lookup_pg = lookup_pg, ref_gen_idxs = ref_gen_idxs, |
26 | 26 | end |
27 | 27 |
|
28 | 28 | optprob = Optimization.OptimizationFunction(opf_objective, |
29 | | - AutoReverseDiff(; compile = true)) |
| 29 | + ADTypes.AutoReverseDiff(; compile = true)) |
30 | 30 |
|
31 | 31 | test_u0 = [ |
32 | 32 | 0.6292298794022337, |
@@ -134,21 +134,21 @@ res = zero(test_u0) |
134 | 134 |
|
135 | 135 | _f = Optimization.instantiate_function(optprob, |
136 | 136 | test_u0, |
137 | | - AutoReverseDiff(; compile = false), |
| 137 | + ADTypes.AutoReverseDiff(; compile = false), |
138 | 138 | nothing; g = true) |
139 | 139 | _f.f(test_u0, nothing) |
140 | 140 | @test @ballocated($(_f.grad)($res, $test_u0)) > 0 |
141 | 141 |
|
142 | 142 | _f2 = Optimization.instantiate_function(optprob, |
143 | 143 | test_u0, |
144 | | - AutoReverseDiff(; compile = true), |
| 144 | + ADTypes.AutoReverseDiff(; compile = true), |
145 | 145 | nothing; g = true) |
146 | 146 | _f2.f(test_u0, nothing) |
147 | 147 | @test @ballocated($(_f2.grad)($res, $test_u0)) > 0 |
148 | 148 |
|
149 | 149 | _f3 = Optimization.instantiate_function(optprob, |
150 | 150 | test_u0, |
151 | | - AutoEnzyme(), |
| 151 | + ADTypes.AutoEnzyme(), |
152 | 152 | nothing; g = true) |
153 | 153 | _f3.f(test_u0, nothing) |
154 | 154 | @test @ballocated($(_f3.grad)($res, $test_u0)) == 0 |
0 commit comments