Skip to content

Commit

Permalink
Skips failing MacOS tests (#60348)
Browse files Browse the repository at this point in the history
Summary:
Mitigates, but does not fix #60347.

Pull Request resolved: #60348

Reviewed By: ngimel

Differential Revision: D29257917

Pulled By: mruberry

fbshipit-source-id: de9be93ddeda1ca27ea2ff4650162f886d10f1e2
  • Loading branch information
Mike Ruberry authored and facebook-github-bot committed Jun 21, 2021
1 parent 1dee99c commit 5ff407d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/distributions/test_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
torch.set_default_dtype(torch.double)

from torch._six import inf
from torch.testing._internal.common_utils import TestCase, run_tests, set_rng_seed, TEST_WITH_UBSAN, load_tests, \
gradcheck
from torch.testing._internal.common_utils import \
(TestCase, run_tests, set_rng_seed, TEST_WITH_UBSAN, load_tests,
gradcheck, IS_MACOS)
from torch.testing._internal.common_cuda import TEST_CUDA
from torch.autograd import grad
from torch.autograd.functional import jacobian
Expand Down Expand Up @@ -1027,6 +1028,7 @@ def ref_log_prob(idx, val, log_prob):
self.assertEqual(Geometric(p).entropy(), scipy.stats.geom(p.detach().numpy(), loc=-1).entropy(), atol=1e-3, rtol=0)
self.assertEqual(float(Geometric(s).entropy()), scipy.stats.geom(s, loc=-1).entropy().item(), atol=1e-3, rtol=0)

@unittest.skipIf(IS_MACOS, "See https://github.com/pytorch/pytorch/issues/60347")
@unittest.skipIf(not TEST_NUMPY, "NumPy not found")
def test_geometric_sample(self):
set_rng_seed(0) # see Note [Randomized statistical tests]
Expand All @@ -1043,6 +1045,7 @@ def test_binomial(self):
self.assertRaises(NotImplementedError, Binomial(10, p).rsample)
self.assertRaises(NotImplementedError, Binomial(10, p).entropy)

@unittest.skipIf(IS_MACOS, "See https://github.com/pytorch/pytorch/issues/60347")
@unittest.skipIf(not TEST_NUMPY, "NumPy not found")
def test_binomial_sample(self):
set_rng_seed(0) # see Note [Randomized statistical tests]
Expand Down Expand Up @@ -1323,6 +1326,7 @@ def ref_log_prob(idx, x, log_prob):
self._gradcheck_log_prob(Poisson, (rate,))
self._gradcheck_log_prob(Poisson, (rate_1d,))

@unittest.skipIf(IS_MACOS, "See https://github.com/pytorch/pytorch/issues/60347")
@unittest.skipIf(not TEST_NUMPY, "Numpy not found")
def test_poisson_sample(self):
set_rng_seed(1) # see Note [Randomized statistical tests]
Expand Down

0 comments on commit 5ff407d

Please sign in to comment.