File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -16,9 +16,17 @@ function check_available(backend::MixedMode)
16
16
check_available (reverse_backend (backend))
17
17
end
18
18
19
+ @static if isdefined (ADTypes, :NoAutoDiff )
20
+ check_available (:: ADTypes.NoAutoDiff ) = throw (ADTypes. NoAutoDiffSelectedError ())
21
+ end
22
+
19
23
"""
20
24
check_inplace(backend)
21
25
22
26
Check whether `backend` supports differentiation of in-place functions and return a `Bool`.
23
27
"""
24
28
check_inplace (backend:: AbstractADType ) = Bool (inplace_support (backend))
29
+
30
+ @static if isdefined (ADTypes, :NoAutoDiff )
31
+ check_inplace (:: ADTypes.NoAutoDiff ) = throw (ADTypes. NoAutoDiffSelectedError ())
32
+ end
Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ using Test
10
10
11
11
LOGGING = get (ENV , " CI" , " false" ) == " false"
12
12
13
+ if isdefined (ADTypes, :NoAutoDiff )
14
+ @test_throws NoAutoDiffSelectedError check_available (NoAutoDiff ())
15
+ @test_throws NoAutoDiffSelectedError check_inplace (NoAutoDiff ())
16
+ end
17
+
13
18
zero_backends = [AutoZeroForward (), AutoZeroReverse ()]
14
19
15
20
for backend in zero_backends
You can’t perform that action at this time.
0 commit comments