Skip to content

Commit

Permalink
hotfix partials construction
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Aug 11, 2021
1 parent 84d471b commit 47a8a9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SparseDiffTools"
uuid = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
authors = ["Pankaj Mishra <[email protected]>", "Chris Rackauckas <[email protected]>"]
version = "1.16.2"
version = "1.16.3"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
4 changes: 2 additions & 2 deletions src/differentiation/compute_jacobian_ad.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ function ForwardColorJacCache(f::F,x,_chunksize = nothing;

if x isa Array
p = generate_chunked_partials(x,colorvec,chunksize)
t = similar(x,Dual{typeof(ForwardDiff.Tag(f,eltype(vec(x))))})
t = similar(x,Dual{typeof(ForwardDiff.Tag(f,eltype(vec(x)))),eltype(x),length(first(first(p)))})
for i in eachindex(t)
t[i] = Dual{typeof(ForwardDiff.Tag(f,eltype(vec(x))))}(x[i],first(p)[1])
t[i] = Dual{typeof(ForwardDiff.Tag(f,eltype(vec(x)))),eltype(x),length(first(first(p)))}(x[i],ForwardDiff.Partials(first(p)[i]))
end
else
p = adapt.(parameterless_type(x),generate_chunked_partials(x,colorvec,chunksize))
Expand Down

0 comments on commit 47a8a9f

Please sign in to comment.