Update utils.py (#82)

get_gpu_memory should return after the loop is over
This commit is contained in:
magic.chen 2023-05-23 16:02:13 +08:00 committed by GitHub
commit 528c0e78f6

View File

@ -33,7 +33,7 @@ def get_gpu_memory(max_gpus=None):
allocated_memory = torch.cuda.memory_allocated() / (1024 ** 3) allocated_memory = torch.cuda.memory_allocated() / (1024 ** 3)
available_memory = total_memory - allocated_memory available_memory = total_memory - allocated_memory
gpu_memory.append(available_memory) gpu_memory.append(available_memory)
return gpu_memory return gpu_memory