Skip to content

Commit f8ffd05

Browse files
authored
Support ADTypes.NoAutoDiff (#851)
* Support ADTypes.NoAutoDiff * Require ADTypes v1.17 for NoAutoDiff * Specialize inplace_support for NoAutoDiff, update ChangeLog
1 parent c19f07d commit f8ffd05

File tree

5 files changed

+12
-1
lines changed

5 files changed

+12
-1
lines changed

DifferentiationInterface/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased](https://github.com/JuliaDiff/DifferentiationInterface.jl/compare/DifferentiationInterface-v0.7.7...main)
99

10+
- Support the new `ADTypes.NoAutoDiff` ([#851](https://github.com/JuliaDiff/DifferentiationInterface.jl/pull/851))
11+
1012
## [0.7.7](https://github.com/JuliaDiff/DifferentiationInterface.jl/compare/DifferentiationInterface-v0.7.6...DifferentiationInterface-v0.7.7)
1113

1214
- Improve support for empty inputs (still not guaranteed) ([#835](https://github.com/JuliaDiff/DifferentiationInterface.jl/pull/835))

DifferentiationInterface/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ DifferentiationInterfaceTrackerExt = "Tracker"
5656
DifferentiationInterfaceZygoteExt = ["Zygote", "ForwardDiff"]
5757

5858
[compat]
59-
ADTypes = "1.17.0"
59+
ADTypes = "1.18.0"
6060
ChainRulesCore = "1.23.0"
6161
DiffResults = "1.1.0"
6262
Diffractor = "=0.2.6"

DifferentiationInterface/src/utils/check.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ function check_available(backend::MixedMode)
1616
check_available(reverse_backend(backend))
1717
end
1818

19+
check_available(::ADTypes.NoAutoDiff) = throw(ADTypes.NoAutoDiffSelectedError())
20+
1921
"""
2022
check_inplace(backend)
2123

DifferentiationInterface/src/utils/traits.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Return [`InPlaceSupported`](@ref) or [`InPlaceNotSupported`](@ref) in a statical
2323
"""
2424
inplace_support(::AbstractADType) = InPlaceSupported()
2525

26+
inplace_support(::ADTypes.NoAutoDiff) = throw(ADTypes.NoAutoDiffSelectedError())
27+
2628
function inplace_support(backend::SecondOrder)
2729
if inplace_support(inner(backend)) isa InPlaceSupported &&
2830
inplace_support(outer(backend)) isa InPlaceSupported

DifferentiationInterface/test/Core/Internals/backends.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ using Test
1818
fb = AutoSimpleFiniteDiff()
1919
rb = AutoReverseFromPrimitive(AutoSimpleFiniteDiff())
2020

21+
@testset "NoAutoDiff" begin
22+
@test_throws NoAutoDiffSelectedError check_available(NoAutoDiff())
23+
@test_throws NoAutoDiffSelectedError inplace_support(NoAutoDiff())
24+
end
25+
2126
@testset "SecondOrder" begin
2227
backend = SecondOrder(fb, rb)
2328
@test check_available(backend)

0 commit comments

Comments
 (0)