Skip to content

Commit

Permalink
Fix Chunking
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal authored Oct 28, 2023
1 parent b4b816b commit 62fb637
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/highlevel/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ const __init_𝒥 = init_jacobian

# Misc Functions
function __chunksize(::AutoSparseForwardDiff{C}, x) where {C}
return C === nothing ? ForwardDiff.Chunk(x) : C
return C === nothing ? ForwardDiff.Chunk(x) : (C isa Number ? ForwardDiff.Chunk{C}() : C)
end
__chunksize(::AutoSparseForwardDiff{C}) where {C} = C
__chunksize(::AutoForwardDiff{C}, x) where {C} = C === nothing ? ForwardDiff.Chunk(x) : C
__chunksize(::AutoForwardDiff{C}, x) where {C} = C === nothing ? ForwardDiff.Chunk(x) : (C isa Number ? ForwardDiff.Chunk{C}() : C)
__chunksize(::AutoForwardDiff{C}) where {C} = C

__f̂(f, x, idxs) = dot(vec(f(x)), idxs)
Expand Down

0 comments on commit 62fb637

Please sign in to comment.