You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DifferentiationInterface/ext/DifferentiationInterfaceChainRulesCoreExt/DifferentiationInterfaceChainRulesCoreExt.jl
Base.Experimental.register_error_hint(StackOverflowError) do io, exc, argtypes, kwargs
134
-
f_name =string(exc.f)
135
-
if (
136
-
f_name =="mode"||
137
-
contains(f_name, "pushforward") ||
138
-
contains(f_name, "pullback") ||
139
-
contains(f_name, "derivative") ||
140
-
contains(f_name, "gradient") ||
141
-
contains(f_name, "jacobian") ||
142
-
contains(f_name, "hvp") ||
143
-
contains(f_name, "hessian")
134
+
Base.Experimental.register_error_hint(StackOverflowError) do io, exc
135
+
print(
136
+
io,
137
+
"""\n
138
+
HINT: One of DifferentiationInterface's functions might be missing a method, which would trigger an endless loop of `pullback` calling `pushforward` and vice-versa.
139
+
Some possible fixes:
140
+
- switch to another backend
141
+
- if you don't want to switch, load the package extension corresponding to your backend
142
+
- if your backend is already loaded, define the primitive operator for the right combination of argument types
143
+
""",
144
144
)
145
-
for T in argtypes
146
-
if T <:AbstractADType
147
-
print(
148
-
io,
149
-
"""\n
150
-
HINT: One of DifferentiationInterface's functions is missing a method, which causes an endless loop of `pullback` calling `pushforward` and vice-versa.
151
-
Some possible fixes:
152
-
- switch to another backend
153
-
- if you don't want to switch, load the package extension corresponding to backend `$T`
154
-
- if the package is already loaded, define the method `$f_name` for the right combination of argument types
0 commit comments