Skip to content

Commit

Permalink
Set a seed for a flaky pymc3.tests.test_sampling test
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonwillard authored and michaelosthege committed Mar 28, 2021
1 parent c744775 commit a3164e7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pymc3/tests/test_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,8 @@ def test_layers(self):
a = pm.Uniform("a", lower=0, upper=1, size=10)
b = pm.Binomial("b", n=1, p=a, size=10)

model.default_rng.get_value(borrow=True).seed(232093)

b_sampler = aesara.function([], b)
avg = np.stack([b_sampler() for i in range(10000)]).mean(0)
npt.assert_array_almost_equal(avg, 0.5 * np.ones((10,)), decimal=2)
Expand Down

0 comments on commit a3164e7

Please sign in to comment.