Skip to content

Commit 70cb8b7

Browse files
fix decompression indexing
1 parent 8e3a06e commit 70cb8b7

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
@@ -108,8 +108,8 @@ function forwarddiff_color_jacobian!(J::AbstractMatrix{<:Number},
108108
rows_index, cols_index = ArrayInterface.findstructralnz(sparsity)
109109
for j in 1:chunksize
110110
dx .= partials.(fx, j)
111-
if ArrayInterface.fast_scalar_indexing(x1)
112-
for k in eachindex(cols_index)
111+
if ArrayInterface.fast_scalar_indexing(dx)
112+
for k in 1:length(cols_index)
113113
if color[cols_index[k]] == color_i
114114
if J isa SparseMatrixCSC
115115
J.nzval[k] = dx[rows_index[k]]

0 commit comments

Comments
 (0)