I followed the steps in this link to install PyTorch from Conda (Anaconda) : https://timoast.github.io/blog/installing-pytorch/
I then added the kernel for the virtualenv