Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.

Commit 47a8a9f

Browse files
hotfix partials construction
1 parent 84d471b commit 47a8a9f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SparseDiffTools"
22
uuid = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
33
authors = ["Pankaj Mishra <[email protected]>", "Chris Rackauckas <[email protected]>"]
4-
version = "1.16.2"
4+
version = "1.16.3"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

src/differentiation/compute_jacobian_ad.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ function ForwardColorJacCache(f::F,x,_chunksize = nothing;
2727

2828
if x isa Array
2929
p = generate_chunked_partials(x,colorvec,chunksize)
30-
t = similar(x,Dual{typeof(ForwardDiff.Tag(f,eltype(vec(x))))})
30+
t = similar(x,Dual{typeof(ForwardDiff.Tag(f,eltype(vec(x)))),eltype(x),length(first(first(p)))})
3131
for i in eachindex(t)
32-
t[i] = Dual{typeof(ForwardDiff.Tag(f,eltype(vec(x))))}(x[i],first(p)[1])
32+
t[i] = Dual{typeof(ForwardDiff.Tag(f,eltype(vec(x)))),eltype(x),length(first(first(p)))}(x[i],ForwardDiff.Partials(first(p)[i]))
3333
end
3434
else
3535
p = adapt.(parameterless_type(x),generate_chunked_partials(x,colorvec,chunksize))

0 commit comments

Comments
 (0)