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
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 @@
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 @@
@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)