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

Commit 7879092

Browse files
always fully make the dual
1 parent 93a8287 commit 7879092

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/differentiation/compute_jacobian_ad.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function ForwardColorJacCache(f::F,x,_chunksize = nothing;
4141
end
4242
else
4343
p = adapt.(parameterless_type(x),generate_chunked_partials(x,colorvec,chunksize))
44-
_t = Dual{T}.(vec(x),first(p))
44+
_t = Dual{T,eltype(x),length(first(first(p)))}.(vec(x),first(p))
4545
t = ArrayInterface.restructure(x,_t)
4646
end
4747

@@ -52,7 +52,7 @@ function ForwardColorJacCache(f::F,x,_chunksize = nothing;
5252
else
5353
tup = ArrayInterface.allowed_getindex(ArrayInterface.allowed_getindex(p,1),1) .* false
5454
_pi = adapt(parameterless_type(dx),[tup for i in 1:length(dx)])
55-
fx = reshape(Dual{T}.(vec(dx),_pi),size(dx)...)
55+
fx = reshape(Dual{T,eltype(dx),length(tup)}.(vec(dx),_pi),size(dx)...)
5656
_dx = dx
5757
end
5858

0 commit comments

Comments
 (0)