gpu controle

BABY CAT·2023년 7월 17일
0

vm

목록 보기
2/3

숫자 부분 변경으로

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

1개의 댓글

comment-user-thumbnail
2023년 7월 17일

소중한 정보 잘 봤습니다!

답글 달기