From f36a84b71b6a9629169ae239137c9f67a9cdea8e Mon Sep 17 00:00:00 2001 From: Brennan Vincent Date: Wed, 12 Dec 2018 08:49:04 -0800 Subject: [PATCH] fix some tests that I accidentally disabled (#15077) Summary: While moving these scenarios into `_test_dim_ops` I accidentally left an empty loop in the actual tests, causing them to do nothing. Pull Request resolved: https://github.com/pytorch/pytorch/pull/15077 Differential Revision: D13428759 Pulled By: umanwizard fbshipit-source-id: 08f53068981d9192c1408878b168e9053f4dc92e --- test/test_torch.py | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/test/test_torch.py b/test/test_torch.py index 1eebcfc..9be44f7 100644 --- a/test/test_torch.py +++ b/test/test_torch.py @@ -93,9 +93,6 @@ class BytesIOContext(io.BytesIO): def __exit__(self, *args): pass -DIM_TEST_SCENARIOS = [ -] - # This is intentionally prefixed by an underscore. Otherwise pytest will try to # run its methods as test cases. @@ -1973,27 +1970,24 @@ class _TestTorchMixin(object): @unittest.skipIf(not TEST_NUMPY, 'Numpy not found') def test_sum_dim(self): - for sizes, dim in DIM_TEST_SCENARIOS: - self._test_dim_ops( - lambda t, d: t.sum(d), - lambda n, d: n.sum(d)) + self._test_dim_ops( + lambda t, d: t.sum(d), + lambda n, d: n.sum(d)) @unittest.skipIf(not TEST_NUMPY, 'Numpy not found') def test_mean_dim(self): - for sizes, dim in DIM_TEST_SCENARIOS: - self._test_dim_ops( - lambda t, d: t.mean(d), - lambda n, d: n.mean(d), - use_integral=False) + self._test_dim_ops( + lambda t, d: t.mean(d), + lambda n, d: n.mean(d), + use_integral=False) @unittest.skipIf(not TEST_NUMPY, 'Numpy not found') def test_std_dim(self): for unbiased in [False, True]: - for sizes, dim in DIM_TEST_SCENARIOS: - self._test_dim_ops( - lambda t, d: t.std(d, unbiased=unbiased), - lambda n, d: n.std(d, ddof=1 if unbiased else 0), - use_integral=False) + self._test_dim_ops( + lambda t, d: t.std(d, unbiased=unbiased), + lambda n, d: n.std(d, ddof=1 if unbiased else 0), + use_integral=False) def test_sum_out(self): x = torch.rand(100, 100) -- 2.7.4