Improve GPU name (#5478)
* Improve GPU name * Update torch_utils.py * Update torch_utils.py * Update torch_utils.py * Update torch_utils.pypull/5483/head
parent
0eb37ad8af
commit
df30426c03
|
@ -75,7 +75,7 @@ def select_device(device='', batch_size=None):
|
|||
space = ' ' * (len(s) + 1)
|
||||
for i, d in enumerate(devices):
|
||||
p = torch.cuda.get_device_properties(i)
|
||||
s += f"{'' if i == 0 else space}CUDA:{d} ({p.name}, {p.total_memory / 1024 ** 2}MB)\n" # bytes to MB
|
||||
s += f"{'' if i == 0 else space}CUDA:{d} ({p.name}, {p.total_memory / 1024 ** 2:.0f}MiB)\n" # bytes to MB
|
||||
else:
|
||||
s += 'CPU\n'
|
||||
|
||||
|
|
Loading…
Reference in New Issue