Skip to content

Commit

Permalink
Forward RNG argument
Browse files Browse the repository at this point in the history
  • Loading branch information
FredericWantiez committed Mar 8, 2024
1 parent fb66279 commit d575089
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions perf/p0.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Random
using Libtask
using Turing, DynamicPPL, AdvancedPS
using BenchmarkTools
Expand All @@ -13,7 +14,8 @@ end


# Case 1: Sample from the prior.
m = Turing.Core.TracedModel(gdemo(1.5, 2.), SampleFromPrior(), VarInfo())
rng = MersenneTwister()
m = Turing.Core.TracedModel(gdemo(1.5, 2.), SampleFromPrior(), VarInfo(), rng)
f = m.evaluator[1];
args = m.evaluator[2:end];

Expand All @@ -26,7 +28,7 @@ println("Run a tape...")
@btime t.tf(args...)

# Case 2: SMC sampler
m = Turing.Core.TracedModel(gdemo(1.5, 2.), Sampler(SMC(50)), VarInfo());
m = Turing.Core.TracedModel(gdemo(1.5, 2.), Sampler(SMC(50)), VarInfo(), rng)
f = m.evaluator[1];
args = m.evaluator[2:end];

Expand Down

0 comments on commit d575089

Please sign in to comment.