JuliaDiff / SparseDiffTools.jl

Fast jacobian computation through sparsity exploitation and matrix coloring
MIT License
237 stars 41 forks source link

Auto(Sparse)ReverseDiff not supported #287

Open gdalle opened 3 months ago

gdalle commented 3 months ago

Problem:

julia> SparseDiffTools.__test_backend_loaded(ADTypes.AutoForwardDiff())
ERROR: AutoForwardDiff{nothing, Nothing}(nothing) requires ForwardDiff.jl to be loaded. Please load it.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] __test_backend_loaded(ad::AutoForwardDiff{nothing, Nothing})
   @ SparseDiffTools ~/.julia/packages/SparseDiffTools/zWIg7/src/highlevel/common.jl:347
 [3] top-level scope
   @ REPL[41]:1

julia> SparseDiffTools.__test_backend_loaded(ADTypes.AutoReverseDiff())
ERROR: AutoReverseDiff(false) requires nothing.jl to be loaded. Please load it.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] __test_backend_loaded(ad::AutoReverseDiff)
   @ SparseDiffTools ~/.julia/packages/SparseDiffTools/zWIg7/src/highlevel/common.jl:347
 [3] top-level scope
   @ REPL[42]:1

Solution: edit the following lines to add the ReverseDiff case https://github.com/JuliaDiff/SparseDiffTools.jl/blob/d2f35b7b11371021587e0d5eb34f417405b144b5/src/highlevel/common.jl#L344-L355