Skip to content

Commit

Permalink
Set model seed correctly in pymc3.tests.test_ndarray_backend
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonwillard committed Mar 23, 2021
1 parent 3e5d206 commit 20ddb4c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pymc3/tests/test_ndarray_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,12 @@ def test_sample_posterior_predictive(self, tmpdir_factory):

assert save_dir == directory

seed = 10
np.random.seed(seed)
with TestSaveLoad.model():
with TestSaveLoad.model() as model:
model.default_rng.get_value(borrow=True).seed(10)
ppc = pm.sample_posterior_predictive(self.trace)

seed = 10
np.random.seed(seed)
with TestSaveLoad.model():
with TestSaveLoad.model() as model:
model.default_rng.get_value(borrow=True).seed(10)
trace2 = pm.load_trace(directory)
ppc2 = pm.sample_posterior_predictive(trace2)
ppc2f = pm.sample_posterior_predictive(trace2)
Expand Down

0 comments on commit 20ddb4c

Please sign in to comment.