Skip to content

Commit fde1f00

Browse files
chore: rm debug statement
1 parent 24ac15f commit fde1f00

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

ext/SciMLBaseZygoteExt.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ function obs_grads(VA, sym, ::Nothing, Δ)
128128
Zygote.nt_nothing(VA)
129129
end
130130

131-
function not_obs_grads(VA::DESolution, sym, not_obss_idx, i, Δ)
131+
function not_obs_grads(VA::ODESolution{T}, sym, not_obss_idx, i, Δ) where {T}
132132
Δ′ = map(enumerate(VA.u)) do (t_idx, us)
133133
map(enumerate(us)) do (u_idx, u)
134134
if u_idx in i
@@ -144,7 +144,7 @@ function not_obs_grads(VA::DESolution, sym, not_obss_idx, i, Δ)
144144
end
145145

146146
@adjoint function Base.getindex(
147-
VA::ODESolution, sym::Union{Tuple, AbstractVector})
147+
VA::ODESolution{T}, sym::Union{Tuple, AbstractVector}) where {T}
148148
function ODESolution_getindex_pullback(Δ)
149149
sym = sym isa Tuple ? collect(sym) : sym
150150
i = map(x -> symbolic_type(x) != NotSymbolic() ? variable_index(VA, x) : x, sym)
@@ -165,7 +165,6 @@ end
165165
@adjoint function Base.getindex(VA::SciMLBase.NonlinearSolution, sym)
166166
function NonlinearSolution_getindex_pullback(Δ)
167167
i = symbolic_type(sym) != NotSymbolic() ? variable_index(VA, sym) : sym
168-
@show sym
169168
if is_observed(VA, sym)
170169
f = observed(VA, sym)
171170
p = parameter_values(VA)
@@ -177,7 +176,6 @@ end
177176
f.f_oop(u, _p)
178177
end
179178
gs = back(Δ)
180-
# (gs[1], nothing)
181179
((u = gs[1], prob = (p = gs[2],)), nothing)
182180
elseif i === nothing
183181
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."))
@@ -227,7 +225,6 @@ end
227225
uType2
228226
}
229227
function NonlinearSolutionAdjoint(ȳ)
230-
@show
231228
(ȳ, ntuple(_ -> nothing, length(args))...)
232229
end
233230
NonlinearSolution{T, N, uType, R, P, A, O, uType2}(u, args...), NonlinearSolutionAdjoint
@@ -236,7 +233,6 @@ end
236233
@adjoint function literal_getproperty(sol::SciMLBase.AbstractNoTimeSolution,
237234
::Val{:u})
238235
function solu_adjoint(Δ)
239-
@show "her"
240236
zerou = zero(sol.prob.u0)
241237
= @. ifelse=== nothing, zerou, Δ)
242238
(build_solution(sol.prob, sol.alg, _Δ, sol.resid),)

0 commit comments

Comments
 (0)