mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
restore 'unused' variable to fix test_cuda_device_memory_allocated (#143885)
This PR fix `test_cuda_multigpu.py::TestCudaMultiGPU::test_cuda_device_memory_allocated`
by restoring a deleted 'unused' variable from commit d8c8ba2440
Pull Request resolved: https://github.com/pytorch/pytorch/pull/143885
Approved by: https://github.com/Skylion007
Co-authored-by: Aaron Gokaslan <aaronGokaslan@gmail.com>
This commit is contained in:
committed by
PyTorch MergeBot
parent
0de661dc27
commit
928e01545c
@ -1303,6 +1303,7 @@ 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(
|
||||
|
Reference in New Issue
Block a user