MCPcopy Create free account
hub / github.com/OpenGVLab/UniFormerV2 / gpu_mem_usage

Function gpu_mem_usage

slowfast/utils/misc.py:53–61  ·  view source on GitHub ↗

Compute the GPU memory usage for the current device (GB).

()

Source from the content-addressed store, hash-verified

51
52
53def gpu_mem_usage():
54 """
55 Compute the GPU memory usage for the current device (GB).
56 """
57 if torch.cuda.is_available():
58 mem_usage_bytes = torch.cuda.max_memory_allocated()
59 else:
60 mem_usage_bytes = 0
61 return mem_usage_bytes / 1024 ** 3
62
63
64def cpu_mem_usage():

Callers 1

log_model_infoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected