Skip to content

Commit

Permalink
Make Zygote extension depend on ForwardDiff too (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
gdalle authored Jun 5, 2024
1 parent 042d75f commit 7d99da1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DifferentiationInterface/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ DifferentiationInterfaceReverseDiffExt = "ReverseDiff"
DifferentiationInterfaceSymbolicsExt = "Symbolics"
DifferentiationInterfaceTapirExt = "Tapir"
DifferentiationInterfaceTrackerExt = "Tracker"
DifferentiationInterfaceZygoteExt = "Zygote"
DifferentiationInterfaceZygoteExt = ["Zygote", "ForwardDiff"]

[compat]
ADTypes = "1.2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ using DifferentiationInterface:
NoPullbackExtras,
PullbackExtras
using DocStringExtensions
using ForwardDiff: ForwardDiff
using Zygote:
ZygoteRuleConfig, gradient, hessian, jacobian, pullback, withgradient, withjacobian
using Compat
Expand Down Expand Up @@ -93,9 +94,9 @@ function DI.jacobian!(f, jac, backend::AutoZygote, x, extras::NoJacobianExtras)
return copyto!(jac, DI.jacobian(f, backend, x, extras))
end

## HVP (with ForwardDiff)
## HVP

# TODO: find a way to do this without cheating?
# Beware, this uses ForwardDiff for the inner differentiation

struct ZygoteHVPExtras{G,PE} <: HVPExtras
∇f::G
Expand Down

0 comments on commit 7d99da1

Please sign in to comment.