File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 70
70
To generate a `Model`, call `model_generator(x_value)`.
71
71
"""
72
72
macro model (input_expr)
73
- build_model_info (input_expr) |> replace_tilde! |> replace_vi! |>
73
+ Base . replace_ref_end! (input_expr) |> build_model_info |> replace_tilde! |> replace_vi! |>
74
74
replace_logpdf! |> replace_sampler! |> build_output
75
75
end
76
76
Original file line number Diff line number Diff line change @@ -212,6 +212,15 @@ priors = 0 # See "new grammar" test.
212
212
model (varinfo)
213
213
@test getlogp (varinfo) == lp
214
214
@test varinfo === _varinfo
215
+
216
+ # test DPPL#61
217
+ @model testmodel (z) = begin
218
+ m ~ Normal ()
219
+ z[1 : end ] ~ MvNormal (fill (m, length (z)), 1.0 )
220
+ return m
221
+ end
222
+ model = testmodel (rand (10 ))
223
+ @test all (z -> isapprox (z, 0 ; atol = 0.2 ), mean (model () for _ in 1 : 1000 ))
215
224
end
216
225
@testset " nested model" begin
217
226
function makemodel (p)
You can’t perform that action at this time.
0 commit comments