@@ -522,18 +522,18 @@ def evaluate(args, has_test_split, devices, kg):
522522
523523
524524def get_devices (use_cuda ):
525- """Get the devices to put the data and the model based on whether to use GPUs and, if so, how many of them are available."""
526- if torch .cuda .device_count () >= 2 and use_cuda :
527- [device0 , device1 ] = nv_usage .get_gpu_index (2 )
528- print ("device0: {}, device1: {}" .format (device0 , device1 ))
529- elif torch .cuda .device_count () == 1 and use_cuda :
530- device0 = torch .device ("cuda:0" )
531- device1 = torch .device ("cuda:0" )
532- else :
533- device0 = torch .device ("cpu" )
534- device1 = torch .device ("cpu" )
535- # device0 = torch.device("cuda:7" )
536- # device1 = torch.device("cuda:7")
525+ # """Get the devices to put the data and the model based on whether to use GPUs and, if so, how many of them are available."""
526+ # if torch.cuda.device_count() >= 2 and use_cuda:
527+ # [device0, device1] = nv_usage.get_gpu_index(2)
528+ # print("device0: {}, device1: {}".format(device0, device1))
529+ # elif torch.cuda.device_count() == 1 and use_cuda:
530+ # device0 = torch.device("cuda:0")
531+ # device1 = torch.device("cuda:0")
532+ # else:
533+ # device0 = torch.device("cpu")
534+ # device1 = torch.device("cpu")
535+ [ device0 ] = nv_usage . get_gpu_index ( 1 )
536+ device1 = device0
537537 return device0 , device1
538538
539539
0 commit comments