glenn-jocher
commited on
Commit
•
df30426
1
Parent(s):
0eb37ad
Improve GPU name (#5478)
Browse files* Improve GPU name
* Update torch_utils.py
* Update torch_utils.py
* Update torch_utils.py
* Update torch_utils.py
- utils/torch_utils.py +1 -1
utils/torch_utils.py
CHANGED
@@ -75,7 +75,7 @@ def select_device(device='', batch_size=None):
|
|
75 |
space = ' ' * (len(s) + 1)
|
76 |
for i, d in enumerate(devices):
|
77 |
p = torch.cuda.get_device_properties(i)
|
78 |
-
s += f"{'' if i == 0 else space}CUDA:{d} ({p.name}, {p.total_memory / 1024 ** 2}
|
79 |
else:
|
80 |
s += 'CPU\n'
|
81 |
|
|
|
75 |
space = ' ' * (len(s) + 1)
|
76 |
for i, d in enumerate(devices):
|
77 |
p = torch.cuda.get_device_properties(i)
|
78 |
+
s += f"{'' if i == 0 else space}CUDA:{d} ({p.name}, {p.total_memory / 1024 ** 2:.0f}MiB)\n" # bytes to MB
|
79 |
else:
|
80 |
s += 'CPU\n'
|
81 |
|