Skip to content

Commit 14db402

Browse files
test: pick out the tunables of initialization problem adjoint
1 parent 1c22f35 commit 14db402

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

ext/SciMLBaseZygoteExt.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ end
164164

165165
@adjoint function Base.getindex(VA::SciMLBase.NonlinearSolution, sym)
166166
function NonlinearSolution_getindex_pullback(Δ)
167-
@show "in the getindwx"
168167
i = symbolic_type(sym) != NotSymbolic() ? variable_index(VA, sym) : sym
169168
if is_observed(VA, sym)
170169
f = observed(VA, sym)
@@ -177,8 +176,6 @@ end
177176
f.f_oop(u, _p)
178177
end
179178
gs = back(Δ)
180-
# @show gs[2]
181-
# @show Δ
182179
((u = gs[1], prob = (p = (tunable = gs[2],),)), nothing)
183180
elseif i === nothing
184181
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."))

test/downstream/observables_autodiff.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ end
101101
gs, = gradient(isol) do isol
102102
isol[sys.ampermeter.i]
103103
end
104-
gt = gs.prob.p
104+
gt = gs.prob.p.tunable
105105
@test length(findall(!iszero, gt)) == 1
106106
end
107107
end

0 commit comments

Comments
 (0)