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

@ -1011,7 +1011,8 @@ class TestCudaMultiGPU(TestCase):
torch.cuda.synchronize()
before_free_bytes, before_available_bytes = torch.cuda.mem_get_info(device)
# increasing to 8MB to force acquiring a new block and overcome blocksize differences across platforms
t = torch.randn(1024 * 1024 * 8, device=device)
t = torch.randn(1024 * 1024 * 8, device=device) # noqa: F841
if IS_JETSON:
# w/o syncing, mem_get_info will run before memory allocated has actually increased.
# This race condition causes consistent failure
@ -1302,7 +1303,6 @@ t2.start()
device_count = torch.cuda.device_count()
current_alloc = [memory_allocated(idx) for idx in range(device_count)]
x = torch.ones(10, device="cuda:0")
self.assertGreater(memory_allocated(0), current_alloc[0])
self.assertTrue(
all(