From ca17e38a1083610a3bd5bffcc09cdcdac7cc6c6c Mon Sep 17 00:00:00 2001 From: Ricardo Date: Mon, 17 May 2021 10:33:43 +0200 Subject: [PATCH] Add float32 xfail to `test_rice` --- pymc3/tests/test_distributions.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pymc3/tests/test_distributions.py b/pymc3/tests/test_distributions.py index bc80f3f1eb6..771f96f6b57 100644 --- a/pymc3/tests/test_distributions.py +++ b/pymc3/tests/test_distributions.py @@ -2531,18 +2531,25 @@ def test_multidimensional_beta_construction(self): with Model(): Beta("beta", alpha=1.0, beta=1.0, size=(10, 20)) + @pytest.mark.xfail( + condition=(aesara.config.floatX == "float32"), + reason="Some combinations underflow to -inf in float32 in pymc version", + ) def test_rice(self): self.check_logp( Rice, Rplus, - {"nu": Rplus, "sigma": Rplusbig}, - lambda value, nu, sigma: sp.rice.logpdf(value, b=nu / sigma, loc=0, scale=sigma), + {"b": Rplus, "sigma": Rplusbig}, + lambda value, b, sigma: sp.rice.logpdf(value, b=b, loc=0, scale=sigma), ) + + def test_rice_nu(self): self.check_logp( Rice, Rplus, - {"b": Rplus, "sigma": Rplusbig}, - lambda value, b, sigma: sp.rice.logpdf(value, b=b, loc=0, scale=sigma), + {"nu": Rplus, "sigma": Rplusbig}, + lambda value, nu, sigma: sp.rice.logpdf(value, b=nu / sigma, loc=0, scale=sigma), + n_samples=-1, ) def test_moyal_logp(self):