Skip to content

Commit f122872

Browse files
committed
Copy shared memory before yielding sampling
1 parent 51f1c8b commit f122872

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pymc3/parallel_sampling.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,15 +285,15 @@ def __iter__(self):
285285
if self._progress is not None:
286286
self._progress[proc.chain - self._start_chain_num].close()
287287

288-
yield Draw(
289-
proc.chain, is_last, draw, tuning,
290-
stats, proc.shared_point_view
291-
)
288+
point = {name: val.copy()
289+
for name, val in proc.shared_point_view.items()}
292290

293291
# Already called for new proc in _make_active
294292
if not is_last:
295293
proc.write_next()
296294

295+
yield Draw(proc.chain, is_last, draw, tuning, stats, point)
296+
297297
def __enter__(self):
298298
self._in_context = True
299299
return self

0 commit comments

Comments
 (0)