Skip to content

Commit fc8cfa6

Browse files
authored
Use copy instead of deepcopy for RNGs (#147)
1 parent a18c12f commit fc8cfa6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sample.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,8 @@ function mcmcsample(
391391
nchunks = min(nchains, Threads.nthreads())
392392
chunksize = cld(nchains, nchunks)
393393
interval = 1:nchunks
394-
rngs = [deepcopy(rng) for _ in interval]
394+
# `copy` instead of `deepcopy` for RNGs: https://github.com/JuliaLang/julia/issues/42899
395+
rngs = [copy(rng) for _ in interval]
395396
models = [deepcopy(model) for _ in interval]
396397
samplers = [deepcopy(sampler) for _ in interval]
397398

0 commit comments

Comments
 (0)