fix some tests that I accidentally disabled (#15077)
authorBrennan Vincent <btv@fb.com>
Wed, 12 Dec 2018 16:49:04 +0000 (08:49 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 12 Dec 2018 17:25:34 +0000 (09:25 -0800)
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

index 1eebcfc..9be44f7 100644 (file)
@@ -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)