Skip to content

Commit

Permalink
Better fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gdalle committed Oct 7, 2024
1 parent de5bc26 commit ef2c608
Showing 1 changed file with 3 additions and 2 deletions.
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 = nothing
cols_index = nothing
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

0 comments on commit ef2c608

Please sign in to comment.