Skip to content

Commit 62fb637

Browse files
authored
Fix Chunking
1 parent b4b816b commit 62fb637

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/highlevel/common.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,10 @@ const __init_𝒥 = init_jacobian
241241

242242
# Misc Functions
243243
function __chunksize(::AutoSparseForwardDiff{C}, x) where {C}
244-
return C === nothing ? ForwardDiff.Chunk(x) : C
244+
return C === nothing ? ForwardDiff.Chunk(x) : (C isa Number ? ForwardDiff.Chunk{C}() : C)
245245
end
246246
__chunksize(::AutoSparseForwardDiff{C}) where {C} = C
247-
__chunksize(::AutoForwardDiff{C}, x) where {C} = C === nothing ? ForwardDiff.Chunk(x) : C
247+
__chunksize(::AutoForwardDiff{C}, x) where {C} = C === nothing ? ForwardDiff.Chunk(x) : (C isa Number ? ForwardDiff.Chunk{C}() : C)
248248
__chunksize(::AutoForwardDiff{C}) where {C} = C
249249

250250
__f̂(f, x, idxs) = dot(vec(f(x)), idxs)

0 commit comments

Comments
 (0)