We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0cab4f5 commit 50e6edeCopy full SHA for 50e6ede
test/compiler.jl
@@ -214,17 +214,15 @@ priors = 0 # See "new grammar" test.
214
@test varinfo === _varinfo
215
end
216
@testset "nested model" begin
217
- function nest(α_0, θ_0)
218
- @model gdemo(x) = begin
219
- λ ~ Gamma(α_0, θ_0)
220
- m ~ Normal(0, √(1 / λ))
221
- x .~ Normal(m, √(1 / λ))
+ function makemodel(p)
+ @model testmodel(x) = begin
+ x[1] ~ Bernoulli(p)
222
global lp = @logpdf()
+ return x
223
224
-
225
- return gdemo
+ return testmodel
226
227
- model = nest(2.0, inv(3.0))([1.5, 2.0])
+ model = makemodel(0.5)([1.0])
228
varinfo = DynamicPPL.VarInfo(model)
229
model(varinfo)
230
@test getlogp(varinfo) == lp
0 commit comments