Commit 433ddd70 authored by ox696c's avatar ox696c
Browse files

Update utils.py

parent 45599737
Pipeline #2898 failed with stages
in 0 seconds
......@@ -33,6 +33,18 @@ import socket
warm_uped = False
def get_device_name(device:torch.device = None):
if torch.cuda.is_available():
if device is None:
num_gpus = torch.cuda.device_count()
gpu_name = []
for gpu_id in range(num_gpus):
gpu_name.append(torch.cuda.get_device_name(gpu_id))
return gpu_name
else:
return torch.cuda.get_device_name(device)
def get_free_ports(n: int, continue_prot: list):
sockets = []
ports = []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment