I am trying to execute code with pytorch in visual studio code, the problem is that I must be able to do it from the CPU. But my idea is that for certain deep learning projects to use the gpu and others not. How can I switch from CPU to GPU when i run
import torch
torch.cuda.is_available()
the output is "False".
i have cuda already installed. I'm using Ubuntu 20.04.2 . It is important for me to do it in Visual Studio Code