Skip to content

Commit 33ad75f

Browse files
committed
Another fix
1 parent 16b885b commit 33ad75f

File tree

1 file changed

+7
-0
lines changed
  • DifferentiationInterface/ext/DifferentiationInterfaceSparseMatrixColoringsExt

1 file changed

+7
-0
lines changed

DifferentiationInterface/ext/DifferentiationInterfaceSparseMatrixColoringsExt/jacobian_mixed.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,13 @@ function _sparse_jacobian_aux!(
213213
end
214214

215215
dummy_seeds_reverse = if isempty(batched_seeds_reverse)
216+
# Only evaluate y when needed for reverse mode dummy seeds
217+
y = if length(f_or_f!y) == 1
218+
f_or_f!y[1](x, map(DI.unwrap, contexts)...)
219+
else
220+
f_or_f!y[1](f_or_f!y[2], x, map(DI.unwrap, contexts)...)
221+
f_or_f!y[2]
222+
end
216223
ntuple(_ -> DI.multibasis(y, Int[]), Val(Br))
217224
else
218225
batched_seeds_reverse[1]

0 commit comments

Comments
 (0)