Skip to content

Commit

Permalink
Add test for pickle with dill
Browse files Browse the repository at this point in the history
  • Loading branch information
aseyboldt committed Jul 7, 2020
1 parent 9789ec6 commit 9e92aa8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pymc3/tests/test_parallel_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,21 @@ def test_bad_unpickle():


tt_vector = tt.TensorType(theano.config.floatX, [False])


@theano.as_op([tt_vector, tt.iscalar], [tt_vector])
def _crash_remote_process(a, master_pid):
if os.getpid() != master_pid:
os.exit(0)
return 2 * np.array(a)


def test_dill():
with pm.Model():
pm.Normal('x')
pm.sample(tune=1, draws=1, chains=2, cores=2, pickle_backend='dill')


def test_remote_pipe_closed():
master_pid = os.getpid()
with pm.Model():
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ seaborn>=0.8.1
sphinx-autobuild==0.7.1
sphinx>=1.5.5
watermark
dill

0 comments on commit 9e92aa8

Please sign in to comment.