Skip to content

Commit a18e7d8

Browse files
Merge pull request #980 from DhairyaLGandhi/dg/steady
HOTFIX: handle `getindex` adjoint for scalar `u`
2 parents 45612a9 + f0bc5e1 commit a18e7d8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ext/SciMLBaseZygoteExt.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ end
176176
((u = gs[1], prob = (p = gs[2],),), nothing)
177177
elseif i === nothing
178178
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."))
179+
elseif i isa Int && VA.u isa Number
180+
(Δ, nothing)
179181
else
180182
VA = recursivecopy(VA)
181183
recursivefill!(VA, zero(eltype(VA)))

0 commit comments

Comments
 (0)