Skip to content

Commit c5206f4

Browse files
committed
Float32 xfail on Beta and StudentT logcdf tests
1 parent 347193e commit c5206f4

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

pymc3/tests/test_distributions.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@ def test_wald_logp_custom_points(self, value, mu, lam, phi, alpha, logp):
11281128
decimals = select_by_precision(float64=6, float32=1)
11291129
assert_almost_equal(model.fastlogp(pt), logp, decimal=decimals, err_msg=str(pt))
11301130

1131-
def test_beta(self):
1131+
def test_beta_logp(self):
11321132
self.check_logp(
11331133
Beta,
11341134
Unit,
@@ -1141,12 +1141,17 @@ def test_beta(self):
11411141
{"mu": Unit, "sigma": Rplus},
11421142
beta_mu_sigma,
11431143
)
1144+
1145+
@pytest.mark.xfail(
1146+
condition=(aesara.config.floatX == "float32"),
1147+
reason="Fails on float32 due to numerical issues",
1148+
)
1149+
def test_beta_logcdf(self):
11441150
self.check_logcdf(
11451151
Beta,
11461152
Unit,
11471153
{"alpha": Rplus, "beta": Rplus},
11481154
lambda value, alpha, beta: sp.beta.logcdf(value, alpha, beta),
1149-
decimal=select_by_precision(float64=5, float32=3),
11501155
)
11511156

11521157
def test_kumaraswamy(self):
@@ -1351,7 +1356,7 @@ def test_lognormal(self):
13511356
lambda value, mu, sigma: sp.lognorm.logcdf(value, sigma, 0, np.exp(mu)),
13521357
)
13531358

1354-
def test_t(self):
1359+
def test_studentt_logp(self):
13551360
self.check_logp(
13561361
StudentT,
13571362
R,
@@ -1364,6 +1369,12 @@ def test_t(self):
13641369
{"nu": Rplus, "mu": R, "sigma": Rplus},
13651370
lambda value, nu, mu, sigma: sp.t.logpdf(value, nu, mu, sigma),
13661371
)
1372+
1373+
@pytest.mark.xfail(
1374+
condition=(aesara.config.floatX == "float32"),
1375+
reason="Fails on float32 due to numerical issues",
1376+
)
1377+
def test_studentt_logcdf(self):
13671378
self.check_logcdf(
13681379
StudentT,
13691380
R,

0 commit comments

Comments
 (0)