Skip to content

Commit edb18e9

Browse files
authored
remove tricks
1 parent f1b7fe1 commit edb18e9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ext/SparseDiffToolsZygoteExt.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import SparseDiffTools: SparseDiffTools, DeivVecTag, AutoDiffVJP, __test_backend
55
import ForwardDiff: ForwardDiff, Dual, partials
66
import SciMLOperators: update_coefficients, update_coefficients!
77
import Setfield: @set!
8-
import Tricks: static_hasmethod
98

109
import SparseDiffTools: numback_hesvec!,
1110
numback_hesvec, autoback_hesvec!, autoback_hesvec, auto_vecjac!,
@@ -101,7 +100,7 @@ end
101100

102101
# VJP methods
103102
function auto_vecjac!(du, f::F, x, v) where {F}
104-
!static_hasmethod(f, typeof((x,))) &&
103+
!hasmethod(f, typeof((x,))) &&
105104
error("For inplace function use autodiff = AutoFiniteDiff()")
106105
du .= reshape(SparseDiffTools.auto_vecjac(f, x, v), size(du))
107106
end
@@ -113,7 +112,7 @@ end
113112

114113
# overload operator interface
115114
function SparseDiffTools._vecjac(f::F, _, u, autodiff::AutoZygote) where {F}
116-
!static_hasmethod(f, typeof((u,))) &&
115+
!hasmethod(f, typeof((u,))) &&
117116
error("For inplace function use autodiff = AutoFiniteDiff()")
118117
pullback = Zygote.pullback(f, u)
119118
return AutoDiffVJP(f, u, (), autodiff, pullback)

0 commit comments

Comments
 (0)