Skip to content

Commit

Permalink
Use copy instead of deepcopy for RNGs (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion authored Oct 4, 2024
1 parent a18c12f commit fc8cfa6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sample.jl
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,8 @@ function mcmcsample(
nchunks = min(nchains, Threads.nthreads())
chunksize = cld(nchains, nchunks)
interval = 1:nchunks
rngs = [deepcopy(rng) for _ in interval]
# `copy` instead of `deepcopy` for RNGs: https://github.com/JuliaLang/julia/issues/42899
rngs = [copy(rng) for _ in interval]
models = [deepcopy(model) for _ in interval]
samplers = [deepcopy(sampler) for _ in interval]

Expand Down

0 comments on commit fc8cfa6

Please sign in to comment.