File tree 1 file changed +4
-2
lines changed
lib/NonlinearSolveBase/src
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,8 @@ const ForwardADs = (
33
33
34
34
function select_forward_mode_autodiff (
35
35
prob:: AbstractNonlinearProblem , ad:: AbstractADType ; warn_check_mode:: Bool = true )
36
- if warn_check_mode && ! (ADTypes. mode (ad) isa ADTypes. ForwardMode)
36
+ if warn_check_mode && ! (ADTypes. mode (ad) isa ADTypes. ForwardMode) &&
37
+ ! (ADTypes. mode (ad) isa ADTypes. ForwardOrReverseMode)
37
38
@warn " The chosen AD backend $(ad) is not a forward mode AD. Use with caution."
38
39
end
39
40
if incompatible_backend_and_problem (prob, ad)
58
59
59
60
function select_reverse_mode_autodiff (
60
61
prob:: AbstractNonlinearProblem , ad:: AbstractADType ; warn_check_mode:: Bool = true )
61
- if warn_check_mode && ! (ADTypes. mode (ad) isa ADTypes. ReverseMode)
62
+ if warn_check_mode && ! (ADTypes. mode (ad) isa ADTypes. ReverseMode) &&
63
+ ! (ADTypes. mode (ad) isa ADTypes. ForwardOrReverseMode)
62
64
if ! is_finite_differences_backend (ad)
63
65
@warn " The chosen AD backend $(ad) is not a reverse mode AD. Use with caution."
64
66
else
You can’t perform that action at this time.
0 commit comments