Skip to content

Commit

Permalink
test: use SciMLStructures interface in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DhairyaLGandhi committed May 26, 2024
1 parent df65237 commit 068c133
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/automatic_sensealg_choice.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Lux, ComponentArrays, OrdinaryDiffEq, SciMLSensitivity, Zygote, Random
using SciMLStructures

rng = Random.default_rng()
tspan = (0.0f0, 8.0f0)
Expand All @@ -18,5 +19,6 @@ end
x0 = [-4.0f0, 0.0f0]
ts = Float32.(collect(0.0:0.01:tspan[2]))
prob = ODEProblem(dxdt_, x0, tspan, θ)
SciMLSensitivity.automatic_sensealg_choice(prob, x0, θ, true) ==
_, repack, _ = SciMLStructures.canonicalize(SciMLStructures.Tunable(), p)
SciMLSensitivity.automatic_sensealg_choice(prob, x0, θ, true, repack) ==
InterpolatingAdjoint{0, true, Val{:central}, EnzymeVJP}(EnzymeVJP(0), false, false)

0 comments on commit 068c133

Please sign in to comment.