@@ -5,12 +5,23 @@ using Distributions
55using DistributionsAD: filldist
66using ADTypes
77using DynamicPPL. Experimental: FastLDF
8+ using DynamicPPL. TestUtils. AD: run_ad, WithExpectedResult, NoTest
9+ using Test
10+
11+ using ForwardDiff: ForwardDiff
12+ using ReverseDiff: ReverseDiff
13+ # Need to include this block here in case we run this test file standalone
14+ @static if VERSION < v " 1.12"
15+ using Pkg
16+ Pkg. add (" Mooncake" )
17+ using Mooncake: Mooncake
18+ end
819
920@testset " Automatic differentiation" begin
1021 # Used as the ground truth that others are compared against.
1122 ref_adtype = AutoForwardDiff ()
1223
13- test_adtypes = if MOONCAKE_SUPPORTED
24+ test_adtypes = @static if VERSION < v " 1.12 "
1425 [
1526 AutoReverseDiff (; compile= false ),
1627 AutoReverseDiff (; compile= true ),
@@ -20,11 +31,6 @@ using DynamicPPL.Experimental: FastLDF
2031 [AutoReverseDiff (; compile= false ), AutoReverseDiff (; compile= true )]
2132 end
2233
23- @testset " Unsupported backends" begin
24- @model demo () = x ~ Normal ()
25- @test_logs (:warn , r" not officially supported" ) FastLDF (demo (); adtype= AutoZygote ())
26- end
27-
2834 @testset " Correctness" begin
2935 @testset " $(m. f) " for m in DynamicPPL. TestUtils. DEMO_MODELS
3036 varinfo = VarInfo (m)
0 commit comments