From 9e92aa8e9c4302f4c0c2f229d6b292144f2a2e63 Mon Sep 17 00:00:00 2001 From: Adrian Seyboldt Date: Tue, 7 Jul 2020 12:56:37 +0200 Subject: [PATCH] Add test for pickle with dill --- pymc3/tests/test_parallel_sampling.py | 8 ++++++++ requirements-dev.txt | 1 + 2 files changed, 9 insertions(+) diff --git a/pymc3/tests/test_parallel_sampling.py b/pymc3/tests/test_parallel_sampling.py index fe124864ca9..0be32e0f6ca 100644 --- a/pymc3/tests/test_parallel_sampling.py +++ b/pymc3/tests/test_parallel_sampling.py @@ -51,6 +51,8 @@ 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: @@ -58,6 +60,12 @@ def _crash_remote_process(a, master_pid): 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(): diff --git a/requirements-dev.txt b/requirements-dev.txt index 7544a31085a..4c3d2a2859c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -18,3 +18,4 @@ seaborn>=0.8.1 sphinx-autobuild==0.7.1 sphinx>=1.5.5 watermark +dill