File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,9 +16,17 @@ function check_available(backend::MixedMode)
1616 check_available (reverse_backend (backend))
1717end
1818
19+ @static if isdefined (ADTypes, :NoAutoDiff )
20+ check_available (:: ADTypes.NoAutoDiff ) = throw (ADTypes. NoAutoDiffSelectedError ())
21+ end
22+
1923"""
2024 check_inplace(backend)
2125
2226Check whether `backend` supports differentiation of in-place functions and return a `Bool`.
2327"""
2428check_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
1010
1111LOGGING = get (ENV , " CI" , " false" ) == " false"
1212
13+ if isdefined (ADTypes, :NoAutoDiff )
14+ @test_throws NoAutoDiffSelectedError check_available (NoAutoDiff ())
15+ @test_throws NoAutoDiffSelectedError check_inplace (NoAutoDiff ())
16+ end
17+
1318zero_backends = [AutoZeroForward (), AutoZeroReverse ()]
1419
1520for backend in zero_backends
You can’t perform that action at this time.
0 commit comments