@@ -5,7 +5,6 @@ import SparseDiffTools: SparseDiffTools, DeivVecTag, AutoDiffVJP, __test_backend
5
5
import ForwardDiff: ForwardDiff, Dual, partials
6
6
import SciMLOperators: update_coefficients, update_coefficients!
7
7
import Setfield: @set!
8
- import Tricks: static_hasmethod
9
8
10
9
import SparseDiffTools: numback_hesvec!,
11
10
numback_hesvec, autoback_hesvec!, autoback_hesvec, auto_vecjac!,
101
100
102
101
# VJP methods
103
102
function auto_vecjac! (du, f:: F , x, v) where {F}
104
- ! static_hasmethod (f, typeof ((x,))) &&
103
+ ! hasmethod (f, typeof ((x,))) &&
105
104
error (" For inplace function use autodiff = AutoFiniteDiff()" )
106
105
du .= reshape (SparseDiffTools. auto_vecjac (f, x, v), size (du))
107
106
end
113
112
114
113
# overload operator interface
115
114
function SparseDiffTools. _vecjac (f:: F , _, u, autodiff:: AutoZygote ) where {F}
116
- ! static_hasmethod (f, typeof ((u,))) &&
115
+ ! hasmethod (f, typeof ((u,))) &&
117
116
error (" For inplace function use autodiff = AutoFiniteDiff()" )
118
117
pullback = Zygote. pullback (f, u)
119
118
return AutoDiffVJP (f, u, (), autodiff, pullback)
0 commit comments