Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit 9e0f8e1

Browse files
committed
Fix range getindexes
1 parent 77d8a23 commit 9e0f8e1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/jacobian.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,24 @@ function Cassette.overdub(ctx::JacobianSparsityContext,
128128
end
129129
end
130130

131+
function Cassette.overdub(ctx::JacobianSparsityContext,
132+
f::typeof(Base.unsafe_copyto!),
133+
X::Tagged,
134+
xstart,
135+
Y::Tagged,
136+
ystart,
137+
len)
138+
S = ctx.metadata
139+
if metatype(Y, ctx) <: JacInput
140+
val = Cassette.fallback(ctx, f, X, xstart, Y, ystart, len)
141+
nometa = Cassette.NoMetaMeta()
142+
X.meta.meta[xstart:xstart+len-1] .= (i->Cassette.Meta(ProvinanceSet(i), nometa)).(ystart:ystart+len-1)
143+
val
144+
else
145+
Cassette.recurse(ctx, f, X, xstart, Y, ystart, len)
146+
end
147+
end
148+
131149
function jacobian_sparsity(f!, Y, X, args...;
132150
sparsity=Sparsity(length(Y), length(X)),
133151
raw = false)

0 commit comments

Comments
 (0)