Skip to content

Commit 428f977

Browse files
committed
Fix more tests
1 parent 9eca78d commit 428f977

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/sampler.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ function AbstractMCMC.step(
5959
)
6060
vi = VarInfo()
6161
strategy = sampler isa SampleFromPrior ? PriorInit() : UniformInit()
62-
DynamicPPL.init!!(rng, model, vi, strategy)
63-
return vi, nothing
62+
_, new_vi = DynamicPPL.init!!(rng, model, vi, strategy)
63+
return new_vi, nothing
6464
end
6565

6666
"""

test/sampler.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
@test length(chains) == N
2626

2727
# `m` is Gaussian, i.e. no transformation is used, so it
28-
# should have a mean equal to its prior, i.e. 2.
29-
@test mean(vi[@varname(m)] for vi in chains) 2 atol = 0.1
28+
# will be drawn from U[-2, 2] and its mean should be 0.
29+
@test mean(vi[@varname(m)] for vi in chains) 0.0 atol = 0.1
3030

3131
# Expected value of ``exp(X)`` where ``X ~ U[-2, 2]`` is ≈ 1.8.
3232
@test mean(vi[@varname(s)] for vi in chains) 1.8 atol = 0.1

0 commit comments

Comments
 (0)