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 92c84b5 commit 6467279Copy full SHA for 6467279
test/fasteval.jl
@@ -75,6 +75,24 @@ end
75
end
76
77
78
+
79
+ @testset "Threaded observe" begin
80
+ if Threads.nthreads() > 1
81
+ @model function threaded(y)
82
+ x ~ Normal()
83
+ Threads.@threads for i in eachindex(y)
84
+ y[i] ~ Normal(x)
85
+ end
86
87
+ N = 100
88
+ model = threaded(zeros(N))
89
+ ldf = DynamicPPL.Experimental.FastLDF(model)
90
91
+ xs = [1.0]
92
+ @test LogDensityProblems.logdensity(ldf, xs) ≈
93
+ logpdf(Normal(), xs[1]) + N * logpdf(Normal(xs[1]), 0.0)
94
95
96
97
98
@testset "FastLDF: performance" begin
0 commit comments