Mark torch.get_device as overridable at the python level (#132706)

Summary:
- add a value to `get_testing_overrides` function for `torch.get_device()`
- remove `torch.get_device()` from the `get_ignored_functions` list

Test Plan:
Existing override testing infra, which should pick up the updates to these two variables.

Closes the loop on:
https://github.com/pytorch/pytorch/pull/132567

Pull Request resolved: https://github.com/pytorch/pytorch/pull/132706
Approved by: https://github.com/ezyang
This commit is contained in:
Gabriel Ferns
2024-10-22 07:20:40 +00:00
committed by PyTorch MergeBot
parent 84e5f34fd1
commit 2b4af6fa74

View File

@ -150,7 +150,6 @@ def get_ignored_functions() -> Set[Callable]:
torch.wait,
torch.as_tensor,
torch.from_numpy,
torch.get_device,
torch.tensor,
torch.default_generator,
torch.has_cuda,
@ -653,6 +652,7 @@ def get_testing_overrides() -> Dict[Callable, Callable]:
torch.gather: lambda input, dim, index, out=None, sparse_grad=False: -1,
torch.gcd: lambda input, other, out=None: -1,
torch.ge: lambda input, other, out=None: -1,
torch.get_device: lambda input: -1,
torch.greater_equal: lambda input, other, out=None: -1,
torch.geqrf: lambda input, out=None: -1,
torch.i0: lambda input, out=None: -1,