Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/differentiation/compute_jacobian_ad.jl
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,9 @@ function forwarddiff_color_jacobian!(J::AbstractMatrix{<:Number},
if FiniteDiff._use_findstructralnz(sparsity)
rows_index, cols_index = ArrayInterface.findstructralnz(sparsity)
else
rows_index = 1:size(J, 1)
cols_index = 1:size(J, 2)
cartind = vec(CartesianIndices(x))
rows_index = Base.Iterators.map(first ∘ Tuple, cartind)
cols_index = Base.Iterators.map(last ∘ Tuple, cartind)
end

# fast path if J and sparsity are both AbstractSparseMatrix and have the same sparsity pattern
Expand Down
Loading