[dynamo] Support range_iterator as a function input (#138657)

Fixes https://github.com/pytorch/pytorch/issues/138654

Pull Request resolved: https://github.com/pytorch/pytorch/pull/138657
Approved by: https://github.com/williamwen42, https://github.com/jansel
This commit is contained in:
Animesh Jain
2024-10-23 13:35:44 -07:00
committed by PyTorch MergeBot
parent e5c3d7ab77
commit b1acd0978e
4 changed files with 42 additions and 2 deletions

View File

@ -20,6 +20,7 @@ from torch.testing._internal.common_dtype import (
from torch.testing._internal.common_utils import (
TestCase, run_tests, skipIfNoSciPy, slowTest, torch_to_numpy_dtype_dict,
parametrize,
skipIfTorchDynamo,
IS_WINDOWS)
from torch.testing._internal.common_device_type import (
OpDTypes, expectedFailureMeta, instantiate_device_type_tests, onlyCPU, dtypes, dtypesIfCUDA, dtypesIfCPU,
@ -2589,7 +2590,7 @@ class TestReductions(TestCase):
self.assertEqual(a[:, ::2, :].median(-1)[0], torch.tensor([[0, 4], [6, 10]], device=device))
self.assertEqual(a[:, ::2, :].nanmedian(-1)[0], torch.tensor([[0, 4], [6, 10]], device=device))
@skipIfTorchDynamo("https://github.com/pytorch/pytorch/pull/138657 discovers a latent bug")
@onlyNativeDeviceTypes
@dtypes(torch.float, torch.double)
def test_quantile(self, device, dtype):