diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 66fdbf9..53a1d3d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -43,4 +43,4 @@ jobs: with: files: lcov.info token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true + fail_ci_if_error: false diff --git a/Project.toml b/Project.toml index 4fbeddd..b8cd5cf 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ADTypes" uuid = "47edcb42-4c32-4615-8424-f2b9edc5f35b" authors = ["Vaibhav Dixit , Guillaume Dalle and contributors"] -version = "1.10.0" +version = "1.11.0" [deps] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" diff --git a/docs/src/index.md b/docs/src/index.md index 2100fb2..254eb68 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -34,6 +34,7 @@ Taylor mode: ```@docs AutoGTPSA +AutoTaylorDiff ``` ### Reverse mode diff --git a/src/ADTypes.jl b/src/ADTypes.jl index 0a1f66d..efc2b1a 100644 --- a/src/ADTypes.jl +++ b/src/ADTypes.jl @@ -47,6 +47,7 @@ export AutoChainRules, AutoReverseDiff, AutoSymbolics, AutoTapir, + AutoTaylorDiff, AutoTracker, AutoZygote @public AbstractMode diff --git a/src/dense.jl b/src/dense.jl index 8f5279f..9359726 100644 --- a/src/dense.jl +++ b/src/dense.jl @@ -197,6 +197,35 @@ function Base.show(io::IO, backend::AutoForwardDiff{chunksize}) where {chunksize print(io, ")") end +""" + AutoTaylorDiff{order} + +Struct used to select the [TaylorDiff.jl](https://github.com/JuliaDiff/TaylorDiff.jl) backend for automatic differentiation. + +Defined by [ADTypes.jl](https://github.com/SciML/ADTypes.jl). + +# Constructors + + AutoTaylorDiff(; order = 1) + +# Type parameters + + - `order`: the order of the Taylor-mode automatic differentiation +""" +struct AutoTaylorDiff{order} <: AbstractADType end + +function AutoTaylorDiff(; order = 1) + return AutoTaylorDiff{order}() +end + +mode(::AutoTaylorDiff) = ForwardMode() + +function Base.show(io::IO, ::AutoTaylorDiff{order}) where {order} + print(io, AutoTaylorDiff, "(") + print(io, "order=", repr(order; context = io)) + print(io, ")") +end + """ AutoGTPSA{D} diff --git a/test/dense.jl b/test/dense.jl index 4f680ca..f724b27 100644 --- a/test/dense.jl +++ b/test/dense.jl @@ -182,6 +182,18 @@ end @test !ad.safe_mode end +@testset "AutoTaylorDiff" begin + ad = AutoTaylorDiff(; order = 2) + @test ad isa AbstractADType + @test ad isa AutoTaylorDiff{2} + @test mode(ad) isa ForwardMode + + ad = AutoTaylorDiff() + @test ad isa AbstractADType + @test ad isa AutoTaylorDiff{1} + @test mode(ad) isa ForwardMode +end + @testset "AutoTracker" begin ad = AutoTracker() @test ad isa AbstractADType