Skip to content

Commit 92aafe1

Browse files
committed
Support ADTypes.NoAutoDiff
1 parent a5fb081 commit 92aafe1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • DifferentiationInterface/src/utils

DifferentiationInterface/src/utils/check.jl

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

19+
@static if isdefined(ADTypes, :NoAutoDiff)
20+
check_available(::ADTypes.NoAutoDiff) = throw(ADTypes.NoAutoDiffAvailable())
21+
end
22+
1923
"""
2024
check_inplace(backend)
2125
2226
Check whether `backend` supports differentiation of in-place functions and return a `Bool`.
2327
"""
2428
check_inplace(backend::AbstractADType) = Bool(inplace_support(backend))
29+
30+
@static if isdefined(ADTypes, :NoAutoDiff)
31+
check_inplace(::ADTypes.NoAutoDiff) = throw(ADTypes.NoAutoDiffAvailable())
32+
end

0 commit comments

Comments
 (0)