From e315ab4f1c83580fa09519525a817ba175804c5c Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Fri, 8 Mar 2024 14:25:21 +0100 Subject: [PATCH 1/3] Add AutoChainRules(ruleconfig) --- src/ADTypes.jl | 7 ++++++- test/runtests.jl | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ADTypes.jl b/src/ADTypes.jl index 63d7039..30a5c1d 100644 --- a/src/ADTypes.jl +++ b/src/ADTypes.jl @@ -14,6 +14,10 @@ abstract type AbstractSparseReverseMode <: AbstractReverseMode end abstract type AbstractSparseForwardMode <: AbstractForwardMode end abstract type AbstractSparseFiniteDifferences <: AbstractFiniteDifferencesMode end +Base.@kwdef struct AutoChainRules{RC} <: AbstractADType + ruleconfig::RC +end + Base.@kwdef struct AutoFiniteDiff{T1, T2, T3} <: AbstractFiniteDifferencesMode fdtype::T1 = Val(:forward) fdjtype::T2 = fdtype @@ -78,7 +82,8 @@ Base.@kwdef struct AutoSparseReverseDiff <: AbstractSparseReverseMode compile::Bool = false end -export AutoFiniteDiff, +export AutoChainRules, + AutoFiniteDiff, AutoFiniteDifferences, AutoForwardDiff, AutoReverseDiff, diff --git a/test/runtests.jl b/test/runtests.jl index f7d6fe8..2d874fc 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -4,6 +4,11 @@ using Test struct CustomTag end @testset "ADTypes.jl" begin + adtype = AutoChainRules(:ruleconfig_placeholder) + @test adtype isa ADTypes.AbstractADType + @test adtype isa AutoChainRules + @test adtype.ruleconfig == :ruleconfig_placeholder + adtype = AutoFiniteDiff() @test adtype isa ADTypes.AbstractADType @test adtype isa AutoFiniteDiff From 83fea72c90434b061367b036a5a835961e7ea0f8 Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Fri, 8 Mar 2024 14:27:20 +0100 Subject: [PATCH 2/3] Bump patch version (new feature but major version is 0) --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 9c8a4d2..3a4bf4b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ADTypes" uuid = "47edcb42-4c32-4615-8424-f2b9edc5f35b" authors = ["Vaibhav Dixit and contributors"] -version = "0.2.6" +version = "0.2.7" [compat] julia = "1.6" From 2f6afad7cf3346ec10a2756844e8ef7a64aa0176 Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Fri, 8 Mar 2024 14:54:06 +0100 Subject: [PATCH 3/3] Debump version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 3a4bf4b..9c8a4d2 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ADTypes" uuid = "47edcb42-4c32-4615-8424-f2b9edc5f35b" authors = ["Vaibhav Dixit and contributors"] -version = "0.2.7" +version = "0.2.6" [compat] julia = "1.6"