import torch
torch.cuda.is_available()
True
May 4, 2023
May 23, 2023
Import pytorch and check if cuda is available.
Pytorch will be able to convert to cuda tensor if (a) GPU is available, (b) the installed version of pytorch was compiled for GPU. In my case, the conda installation failed, pip3 installation instruction provided in the pytorch website worked.
Back to top