@@ -14,7 +14,11 @@ using Turing
14
14
end
15
15
16
16
function randr (
17
- vi:: DynamicPPL.VarInfo , vn:: VarName , dist:: Distribution , spl:: DynamicPPL.Sampler , count:: Bool = false
17
+ vi:: DynamicPPL.VarInfo ,
18
+ vn:: VarName ,
19
+ dist:: Distribution ,
20
+ spl:: DynamicPPL.Sampler ,
21
+ count:: Bool = false ,
18
22
)
19
23
if ! haskey (vi, vn)
20
24
r = rand (dist)
@@ -50,9 +54,9 @@ using Turing
50
54
alg = HMC (0.1 , 5 )
51
55
spl = DynamicPPL. Sampler (alg, model)
52
56
v = copy (meta. vals)
53
- DynamicPPL. link! (vi, spl)
57
+ DynamicPPL. link!! (vi, spl, model )
54
58
@test all (x -> DynamicPPL. istrans (vi, x), meta. vns)
55
- DynamicPPL. invlink! (vi, spl)
59
+ DynamicPPL. invlink!! (vi, spl, model )
56
60
@test all (x -> ! DynamicPPL. istrans (vi, x), meta. vns)
57
61
@test meta. vals == v
58
62
@@ -64,10 +68,10 @@ using Turing
64
68
@test all (x -> ! DynamicPPL. istrans (vi, x), meta. m. vns)
65
69
v_s = copy (meta. s. vals)
66
70
v_m = copy (meta. m. vals)
67
- DynamicPPL. link! (vi, spl)
71
+ DynamicPPL. link!! (vi, spl, model )
68
72
@test all (x -> DynamicPPL. istrans (vi, x), meta. s. vns)
69
73
@test all (x -> DynamicPPL. istrans (vi, x), meta. m. vns)
70
- DynamicPPL. invlink! (vi, spl)
74
+ DynamicPPL. invlink!! (vi, spl, model )
71
75
@test all (x -> ! DynamicPPL. istrans (vi, x), meta. s. vns)
72
76
@test all (x -> ! DynamicPPL. istrans (vi, x), meta. m. vns)
73
77
@test meta. s. vals == v_s
@@ -347,7 +351,7 @@ using Turing
347
351
348
352
n = 10
349
353
model = state_space (y, length (t))
350
- @test size (sample (model, NUTS (; adtype= AutoReverseDiff (true )), n), 1 ) == n
354
+ @test size (sample (model, NUTS (; adtype= AutoReverseDiff (; compile = true )), n), 1 ) == n
351
355
end
352
356
353
357
if Threads. nthreads () > 1
0 commit comments