diff --git a/tests/transforms/test_utils_pytorch_numpy_unification.py b/tests/transforms/test_utils_pytorch_numpy_unification.py index a78fcab0d1..76c378e260 100644 --- a/tests/transforms/test_utils_pytorch_numpy_unification.py +++ b/tests/transforms/test_utils_pytorch_numpy_unification.py @@ -51,10 +51,11 @@ def test_percentile(self): @skip_if_quick def test_many_elements_quantile(self): # pytorch#64947 - for p in TEST_NDARRAYS: - for elements in (1000, 17_000_000): + for elements in (1000, 17_000_000): + data = np.random.randn(elements) + for p in TEST_NDARRAYS: + x = p(data) for t in [*TEST_NDARRAYS, list]: - x = p(np.random.randn(elements)) q = percentile(x, t([10, 50])) if isinstance(x, torch.Tensor): self.assertIsInstance(q, torch.Tensor)