Skip to content

Commit c5f82f9

Browse files
chore: pass p directly
1 parent 615647d commit c5f82f9

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

ext/SciMLBaseZygoteExt.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,13 @@ end
8585
if is_observed(VA, sym)
8686
f = observed(VA, sym)
8787
p = parameter_values(VA)
88-
tunables, repack, _ = SciMLStructures.canonicalize(SciMLStructures.Tunable(), p)
8988
u = state_values(VA)
9089
t = current_time(VA)
91-
y, back = Zygote.pullback(u, tunables) do u, tunables
92-
_p = repack(tunables)
93-
f.(u, Ref(_p), t)
90+
y, back = Zygote.pullback(u, p) do u, p
91+
f.(u, Ref(p), t)
9492
end
9593
gs = back(Δ)
96-
((u = gs[1], prob = (p = (tunable = gs[2],),)), nothing)
94+
(u = gs[1], prob = (p = gs[2],),), nothing
9795
elseif i === nothing
9896
throw(error("Zygote AD of purely-symbolic slicing for observed quantities is not yet supported. Work around this by using `A[sym,i]` to access each element sequentially in the function being differentiated."))
9997
else

0 commit comments

Comments
 (0)