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 7070To generate a `Model`, call `model_generator(x_value)`.
7171"""
7272macro 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! |>
7474 replace_logpdf! |> replace_sampler! |> build_output
7575end
7676
Original file line number Diff line number Diff line change @@ -212,6 +212,15 @@ priors = 0 # See "new grammar" test.
212212 model (varinfo)
213213 @test getlogp (varinfo) == lp
214214 @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 ))
215224 end
216225 @testset " nested model" begin
217226 function makemodel (p)
You can’t perform that action at this time.
0 commit comments