Fixed bug in task_manager.is_alive and added way to check for first device.

This commit is contained in:
Marc-Andre Ferland
2022-10-16 23:06:41 -04:00
parent 994d62ac65
commit 41bfb96b6b
2 changed files with 11 additions and 9 deletions

View File

@ -149,12 +149,10 @@ def device_init(device_selection=None):
thread_data.device = 'cpu'
def is_first_cuda_device(device):
if thread_data.device == 0 or thread_data.device == '0':
return True
if thread_data.device == 'cuda' or thread_data.device == 'cuda:0':
return True
if thread_data.device == torch.device(0):
return True
if device is None: return False
if device == 0 or device == '0': return True
if device == 'cuda' or device == 'cuda:0': return True
if device == torch.device(0): return True
return False
def load_model_ckpt():