Skip to content

Commit 6184c69

Browse files
fix: fix observed variable adjoint
1 parent 9b96078 commit 6184c69

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ext/SciMLBaseZygoteExt.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,12 @@ end
106106
if is_observed(VA, sym)
107107
f = observed(VA, sym)
108108
p = parameter_values(VA)
109-
tunables, _, _ = SciMLStructures.canonicalize(SciMLStructures.Tunable(), p)
109+
tunables, repack, _ = SciMLStructures.canonicalize(SciMLStructures.Tunable(), p)
110110
u = state_values(VA)
111111
t = current_time(VA)
112112
y, back = Zygote.pullback(u, tunables) do u, tunables
113-
f.(u, Ref(tunables), t)
113+
_p = repack(tunables)
114+
f.(u, Ref(_p), t)
114115
end
115116
gs = back(Δ)
116117
(gs[1], nothing)

0 commit comments

Comments
 (0)