@@ -161,21 +161,6 @@ function value_and_hessian(ab::AbstractBackend, f, x)
161
161
return value, hess
162
162
end
163
163
164
- function value_and_hessian (ab:: HigherOrderBackend , f, x)
165
- if x isa Tuple
166
- # only support computation of Hessian for functions with single input argument
167
- x = only (x)
168
- end
169
-
170
- value = f (x)
171
- hess = jacobian (second_lowest (ab), (_x,) -> begin
172
- g = gradient (lowest (ab), f, _x)
173
- return g[1 ] # gradient returns a tuple
174
- end , x)
175
-
176
- return value, hess
177
- end
178
-
179
164
"""
180
165
AD.value_gradient_and_hessian(ab::AD.AbstractBackend, f, x)
181
166
@@ -200,23 +185,6 @@ function value_gradient_and_hessian(ab::AbstractBackend, f, x)
200
185
return value, (grads,), hess
201
186
end
202
187
203
- function value_gradient_and_hessian (ab:: HigherOrderBackend , f, x)
204
- if x isa Tuple
205
- # only support computation of Hessian for functions with single input argument
206
- x = only (x)
207
- end
208
-
209
- value = f (x)
210
- grads, hess = value_and_jacobian (
211
- second_lowest (ab), _x -> begin
212
- g = gradient (lowest (ab), f, _x)
213
- return g[1 ] # gradient returns a tuple
214
- end , x
215
- )
216
-
217
- return value, (grads,), hess
218
- end
219
-
220
188
"""
221
189
AD.pushforward_function(ab::AD.AbstractBackend, f, xs...)
222
190
0 commit comments