Improve GPU name (#5478)

* Improve GPU name

* Update torch_utils.py

* Update torch_utils.py

* Update torch_utils.py

* Update torch_utils.py
This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-11-03 16:59:53 +01:00
1 parent 0eb37ad8af
commit df30426c03
1 file changed
+1 -1
+1 -1
View File
@@ -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'