Skip to content

Commit

Permalink
Add AutoDiffractor
Browse files Browse the repository at this point in the history
  • Loading branch information
gdalle committed Mar 11, 2024
1 parent 4bd7704 commit e3ab11a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ Just run the following code in a Julia REPL to find out:
julia> using ADTypes

julia> names(ADTypes)
16-element Vector{Symbol}:
17-element Vector{Symbol}:
:ADTypes
:AutoChainRules
:AutoDiffractor
:AutoEnzyme
:AutoFiniteDiff
:AutoFiniteDifferences
Expand Down
8 changes: 8 additions & 0 deletions src/ADTypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,15 @@ Base.@kwdef struct AutoSparseReverseDiff <: AbstractSparseReverseMode
compile::Bool = false
end

"""
AutoDiffractor
Chooses [Diffractor.jl](https://github.com/JuliaDiff/Diffractor.jl).
"""
struct AutoDiffractor <: AbstractADType end

export AutoChainRules,
AutoDiffractor,
AutoFiniteDiff,
AutoFiniteDifferences,
AutoForwardDiff,
Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,8 @@ struct CustomTag end
adtype = AutoEnzyme(; mode = Val(:Reverse))
@test adtype isa ADTypes.AbstractADType
@test adtype isa AutoEnzyme{Val{:Reverse}}

adtype = AutoDiffractor()
@test adtype isa ADTypes.AbstractADType
@test adtype isa AutoDiffractor
end

0 comments on commit e3ab11a

Please sign in to comment.