Skip to content

Commit 8420fbc

Browse files
committed
Fix more tests
1 parent c733b77 commit 8420fbc

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

test/turing.jl

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
return nothing
99
end
1010

11-
@model logp_check() = x ~ Normal()
11+
@model function logp_check()
12+
a ~ Normal()
13+
return b ~ Normal()
14+
end
1215

1316
n_samples = 1000
1417
model = demo()
@@ -55,8 +58,15 @@
5558
)
5659

5760
chain_logp_check = sample(
58-
logp_check(), Turing.Gibbs(:x => externalsampler(sampler)), 100; progress=false
61+
logp_check(),
62+
Turing.Gibbs(:a => externalsampler(sampler), :b => externalsampler(sampler)),
63+
100;
64+
progress=false,
65+
)
66+
@test isapprox(
67+
logpdf.(Normal(), chain_logp_check[:a]) .+
68+
logpdf.(Normal(), chain_logp_check[:b]),
69+
chain_logp_check[:lp],
5970
)
60-
@test isapprox(logpdf.(Normal(), chain_logp_check[:x]), chain_logp_check[:lp])
6171
end
6272
end

0 commit comments

Comments
 (0)