From d2d5445d225215f18bc7c5fe04efc0f0e261c58c Mon Sep 17 00:00:00 2001 From: Vedant Puri Date: Thu, 26 Oct 2023 13:47:16 -0400 Subject: [PATCH] use ForwardDiff.jacobian in place of Zygote.forward_jacobian --- src/lib/grad.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/grad.jl b/src/lib/grad.jl index 6b9002f73..9669b39c8 100644 --- a/src/lib/grad.jl +++ b/src/lib/grad.jl @@ -61,7 +61,7 @@ julia> hessian(sin, pi/2) """ hessian(f, x) = hessian_dual(f, x) -hessian_dual(f, x::AbstractArray) = forward_jacobian(x -> gradient(f, x)[1], x)[2] +hessian_dual(f, x::AbstractArray) = ForwardDiff.jacobian(x -> gradient(f, x)[1], x) hessian_dual(f, x::Number) = ForwardDiff.derivative(x -> gradient(f, x)[1], x)