From b354e630b3edfea242eb6c4490e9ff869d1b25d0 Mon Sep 17 00:00:00 2001 From: jburnim Date: Fri, 6 Nov 2020 09:53:23 -0800 Subject: [PATCH] Permit inf samples in ParameterBijectorsTest. During Hypothesis testing in ParameterBijectorsTest, some distributions (such as `GammaGamma`) can generate samples too large to be represented in float32. This change updates the test to just check that samples are non-non, instead of checking that all samples are finite. PiperOrigin-RevId: 341067297 --- .../python/distributions/distribution_properties_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tensorflow_probability/python/distributions/distribution_properties_test.py b/tensorflow_probability/python/distributions/distribution_properties_test.py index 25d53b2310..84289baa35 100644 --- a/tensorflow_probability/python/distributions/distribution_properties_test.py +++ b/tensorflow_probability/python/distributions/distribution_properties_test.py @@ -341,8 +341,8 @@ def testCanConstructAndSampleDistribution(self, data): x = self.evaluate(new_dist.sample(seed=test_util.test_seed())) self.assertEqual(sample_shape, x.shape) - # Valid parameters should give finite samples. - self.assertAllFinite(x) + # Valid parameters should give non-nan samples. + self.assertAllFalse(np.isnan(x)) def _all_shapes(thing):