From f4b44c9af0ddc110ade337c23bef4cc7f013a65c Mon Sep 17 00:00:00 2001 From: Hong Ge <3279477+yebai@users.noreply.github.com> Date: Mon, 2 Sep 2024 19:08:36 +0100 Subject: [PATCH] Update ad_utils.jl --- test/test_utils/ad_utils.jl | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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