MCPcopy Create free account
hub / github.com/chengsen/PyTorch_TextGCN / gpu_mem_get_all

Method gpu_mem_get_all

utils.py:65–67  ·  view source on GitHub ↗

get total, used and free memory (in MBs) for each available gpu

(self)

Source from the content-addressed store, hash-verified

63 return th.device('cpu')
64
65 def gpu_mem_get_all(self):
66 "get total, used and free memory (in MBs) for each available gpu"
67 return list(map(self.gpu_mem_get, range(self.pynvml.nvmlDeviceGetCount())))
68
69 def gpu_mem_get(self, _id=None):
70 """get total, used and free memory (in MBs) for gpu `id`. if `id` is not passed,

Callers 1

get_cuda_idMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected