@@ -271,32 +271,6 @@ function HesVec(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoFo
271271 cache3 = similar (u)
272272
273273 (cache1, cache2, cache3), numauto_hesvec, numauto_hesvec!
274- else
275- @error (" Set autodiff to either AutoForwardDiff(), or AutoFiniteDiff()" )
276- end
277-
278- outofplace = static_hasmethod (f, typeof ((u,)))
279- isinplace = static_hasmethod (f, typeof ((u,)))
280-
281- if ! (isinplace) & ! (outofplace)
282- error (" $f must have signature f(u)." )
283- end
284-
285- L = FwdModeAutoDiffVecProd (f, u, cache, vecprod, vecprod!)
286-
287- FunctionOperator (L, u, u;
288- isinplace = isinplace, outofplace = outofplace,
289- p = p, t = t, islinear = true ,
290- )
291- end
292-
293- function BackHesVec (f, u:: AbstractArray , p = nothing , t = nothing ; autodiff = AutoFiniteDiff ())
294-
295- cache, vecprod, vecprod! = if autodiff isa AutoFiniteDiff
296- cache1 = similar (u)
297- cache2 = similar (u)
298-
299- (cache1, cache2), numback_hesvec, numback_hesvec!
300274 elseif autodiff isa AutoZygote
301275 @assert static_hasmethod (autoback_hesvec, typeof ((f, u, u))) " To use AutoZygote() AD, first load Zygote with `using Zygote`, or `import Zygote`"
302276
@@ -306,6 +280,8 @@ function BackHesVec(f, u::AbstractArray, p = nothing, t = nothing; autodiff = Au
306280 cache2 = copy (u)
307281
308282 (cache1, cache2), autoback_hesvec, autoback_hesvec!
283+ else
284+ @error (" Set autodiff to either AutoForwardDiff(), or AutoFiniteDiff()" )
309285 end
310286
311287 outofplace = static_hasmethod (f, typeof ((u,)))
0 commit comments