GPU_NUM = 3
device = torch.device(f'cuda:{GPU_NUM}' if torch.cuda.is_available() else 'cpu')
torch.cuda.set_device(device) # change allocation of current GPU
print ('Current cuda device ', torch.cuda.current_device()) # check
소중한 정보 잘 봤습니다!
소중한 정보 잘 봤습니다!