Created
November 9, 2020 03:12
-
-
Save juliussin/76317f48a8da36422c396d84d0e6afd0 to your computer and use it in GitHub Desktop.
Check CUDA device and availability on PyTorch.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
print('Torch CUDA Current Device: {}'.format(torch.cuda.current_device())) | |
print('Torch CUDA Device: {}'.format(torch.cuda.device(torch.cuda.current_device()))) | |
print('Torch CUDA Device Count: {}'.format(torch.cuda.device_count())) | |
print('Torch CUDA Device Name: {}'.format(torch.cuda.get_device_name(torch.cuda.current_device()))) | |
print('Torch CUDA Availability: {}'.format(torch.cuda.is_available())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment