mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
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:
committed by
PyTorch MergeBot
parent
d298bd840f
commit
d8c8ba2440
@ -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"))
|
||||
|
Reference in New Issue
Block a user