Fix unused Python variables in test/[e-z]* (#136964)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/136964
Approved by: https://github.com/justinchuby, https://github.com/albanD
This commit is contained in:
Tom Ritchford
2024-12-18 18:14:52 +00:00
committed by PyTorch MergeBot
parent d298bd840f
commit d8c8ba2440
281 changed files with 508 additions and 565 deletions

View File

@ -321,7 +321,6 @@ def implements_tensor_like(torch_function):
return decorator
def generate_tensor_like_torch_implementations():
torch_vars = vars(torch)
untested_funcs = []
testing_overrides = get_testing_overrides()
# test/test_cpp_api_parity.py monkeypatches torch.nn to have a new
@ -1542,8 +1541,6 @@ class TestTorchFunctionMode(TestCase):
self.assertFalse(called)
def test_disable_enable_subclass(self):
called = False
class A(torch.Tensor):
pass
@ -1645,7 +1642,6 @@ class TestTorchFunctionMode(TestCase):
base_mode = BaseTorchFunctionMode()
with base_mode:
torch.set_default_device("cpu")
x = torch.ones(2, 2)
stack = get_stack()
self.assertIsInstance(stack[0], DeviceContext)
self.assertEqual(stack[0].device, torch.device("cpu"))