Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
[compat]
AbstractMCMC = "2, 3"
Distributions = "0.23, 0.24, 0.25"
Libtask = "0.5.3"
Libtask = "0.6"
Random123 = "1.3"
StatsFuns = "0.9"
julia = "1.3"
16 changes: 2 additions & 14 deletions src/container.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ end
const Particle = Trace

function Trace(f, rng::TracedRNG)
ctask = let f = f
Libtask.CTask() do
res = f(rng)
Libtask.produce(nothing)
return res
end
end
ctask = Libtask.CTask(f, rng)

# add backward reference
newtrace = Trace(f, ctask, rng)
Expand Down Expand Up @@ -62,13 +56,7 @@ function forkr(trace::Trace)
newf = reset_model(trace.f)
Random123.set_counter!(trace.rng, 1)

ctask = let f = trace.ctask.task.code
Libtask.CTask() do
res = f()(trace.rng)
Libtask.produce(nothing)
return res
end
end
ctask = Libtask.CTask(newf, trace.rng)

# add backward reference
newtrace = Trace(newf, ctask, trace.rng)
Expand Down
4 changes: 2 additions & 2 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[compat]
AbstractMCMC = "2, 3"
Distributions = "0.24, 0.25"
Libtask = "0.5"
Libtask = "0.6"
julia = "1.3"
Random123 = "1.3"
Random123 = "1.3"