Skip to content

Commit 673880c

Browse files
authored
Make cond test more robust (#1029)
1 parent 1ca72ff commit 673880c

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

test/contrib/test_control_flow.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,8 @@ def false_fun(_):
190190
x = mcmc.get_samples()["x"]
191191
assert x.shape == (10_000,)
192192
assert_allclose(
193-
[
194-
x.mean(),
195-
x.std(),
196-
x[x > 2.0].mean(),
197-
x[x > 2.0].std(),
198-
x[x < 2.0].mean(),
199-
x[x < 2.0].std(),
200-
],
201-
[2.0, jnp.sqrt(5.0), 4.0, 1.0, 0.0, 1.0],
193+
[x[x > 2.0].mean(), x[x > 2.0].std(), x[x < 2.0].mean(), x[x < 2.0].std()],
194+
[4.01, 0.965, -0.01, 0.965],
202195
atol=0.1,
203196
)
197+
assert_allclose([x.mean(), x.std()], [2.0, jnp.sqrt(5.0)], atol=0.5)

0 commit comments

Comments
 (0)