I'm using a virtual environment and I have selected the right interpreter.
Now even after I cmd + p > reload window and
import torch.nn as nn
I don't get any suggestion righting nn. on vscode 1.31.1
I found jedi to be quite slow but the recently released Pylance extension works like a charm: https://github.com/microsoft/pylance-release
and then update your settings
"python.languageServer": "Pylance"
Using the beta version of the Python language server (0.2.17), I get completions.
To turn on the language server, follow these instructions. If the stable version doesn't work then follow those instructions on how to download the beta version of the extension to get the completions.