diff --git a/test/test_utils/ad_utils.jl b/test/test_utils/ad_utils.jl index 90ffb1df4b..d6b7fc19b1 100644 --- a/test/test_utils/ad_utils.jl +++ b/test/test_utils/ad_utils.jl @@ -22,14 +22,6 @@ adbackends = [ Turing.AutoForwardDiff(; chunksize=0), Turing.AutoReverseDiff(; compile=false) ] -# Tapir isn't supported for older Julia versions, hence the check. -install_tapir = isdefined(Turing, :AutoTapir) -if install_tapir - # TODO(mhauru) Is there a better way to install optional dependencies like this? - Pkg.add("Tapir") - push!(adbackends, Turing.AutoTapir(false)) -end - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Stuff for checking that the right AD backend is being used. @@ -62,6 +54,15 @@ const eltypes_by_adtype = Dict( ), ) +# Tapir isn't supported for older Julia versions, hence the check. +install_tapir = isdefined(Turing, :AutoTapir) +if install_tapir + # TODO(mhauru) Is there a better way to install optional dependencies like this? + Pkg.add("Tapir") + push!(adbackends, Turing.AutoTapir(false)) + push!(eltypes_by_adtype, Turing.AutoTapir => (Tapir.CoDual,)) +end + """ AbstractWrongADBackendError