Skip to content

Commit

Permalink
Add extras subtypings
Browse files Browse the repository at this point in the history
  • Loading branch information
gdalle committed Apr 25, 2024
1 parent 0a484ac commit 26e4089
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ module DifferentiationInterfaceEnzymeExt
using ADTypes: ADTypes, AutoEnzyme
import DifferentiationInterface as DI
using DifferentiationInterface:
DerivativeExtras,
GradientExtras,
JacobianExtras,
PullbackExtras,
PushforwardExtras,
NoDerivativeExtras,
NoGradientExtras,
NoJacobianExtras,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ end

## Gradient

struct EnzymeForwardGradientExtras{C,O}
struct EnzymeForwardGradientExtras{C,O} <: GradientExtras
shadow::O
end

Expand Down Expand Up @@ -72,7 +72,7 @@ end

## Jacobian

struct EnzymeForwardOneArgJacobianExtras{C,O}
struct EnzymeForwardOneArgJacobianExtras{C,O} <: JacobianExtras
shadow::O
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ module DifferentiationInterfaceFiniteDiffExt
using ADTypes: AutoFiniteDiff
import DifferentiationInterface as DI
using DifferentiationInterface:
DerivativeExtras,
GradientExtras,
HessianExtras,
JacobianExtras,
PullbackExtras,
PushforwardExtras,
NoDerivativeExtras,
NoGradientExtras,
NoHessianExtras,
NoJacobianExtras,
NoPullbackExtras,
NoPushforwardExtras,
GradientExtras
NoPushforwardExtras
using FiniteDiff:
DerivativeCache,
GradientCache,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ end

## Derivative

struct FiniteDiffOneArgDerivativeExtras{C}
struct FiniteDiffOneArgDerivativeExtras{C} <: DerivativeExtras
cache::C
end

Expand Down Expand Up @@ -128,7 +128,7 @@ end

## Jacobian

struct FiniteDiffOneArgJacobianExtras{C}
struct FiniteDiffOneArgJacobianExtras{C} <: JacobianExtras
cache::C
end

Expand Down Expand Up @@ -166,7 +166,7 @@ end

## Hessian

struct FiniteDiffHessianExtras{C}
struct FiniteDiffHessianExtras{C} <: HessianExtras
cache::C
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ end

## Derivative

struct FiniteDiffTwoArgDerivativeExtras{C}
struct FiniteDiffTwoArgDerivativeExtras{C} <: DerivativeExtras
cache::C
end

Expand Down Expand Up @@ -61,7 +61,7 @@ end

## Jacobian

struct FiniteDiffTwoArgJacobianExtras{C}
struct FiniteDiffTwoArgJacobianExtras{C} <: JacobianExtras
cache::C
end

Expand Down

0 comments on commit 26e4089

Please sign in to comment.