Is there another step to importing Pytorch and using it?
I'm trying to test Pytorch but the first step is to get it running and usable on my computer. I have it to an extent but I need it to function in VS code which it does, it's just that it reads as an error despite working.

I've set up pytorch locally on my computer. I can run the test scripts fine in VS Code's integrated terminal.



The issue comes up when I try to do some work normally in VS code.

from __future__ import print_function
import torch
x = torch.rand(5, 3) //This line has an error. torch.rand(5,3) is not callable)
print(x)


It says that module 'torch' has no 'rand' member. But it still outputs correctly.
Running this in the terminal as a python file or in debug mode results in.

(base) c:\Users\Sean\Desktop\Test\hello&gt;D:\Anaconda\python.exe c:\Users\Sean\.vscode\extensions\ms-python.python-2019.10.44104\pythonFiles\ptvsd_launcher.py --default --client --host localhost --port 63625 c:\Users\Sean\Desktop\Test\hello\something.py
tensor([[0.5449, 0.1669, 0.4740],
        [0.3079, 0.0447, 0.9543],
        [0.9137, 0.3987, 0.5736],
        [0.1788, 0.4932, 0.5584],
        [0.1632, 0.6285, 0.4483]])

(base) c:\Users\Sean\Desktop\Test\hello&gt;D:/Anaconda/Scripts/activate

(base) c:\Users\Sean\Desktop\Test\hello&gt;conda activate Anaconda
Could not find conda environment: Anaconda
You can list all discoverable environments with `conda info --envs`.


So it's working, what I want is to not have it coming up as an error. It'll be hard to find the actual bugs later on if it continues and I feel it might cause problems if not addressed. Any help with telling me the root issue and how to go about fixing it would be appreciated.

Found the answer. The issue was pylint not recognizing Pytorch or Numpty methods. The functions still worked but the error messages make it hard to see actual error messages.

Fixed by adding the following to user settings.

"python.linting.pylintArgs": [
"--errors-only",
"--generated-members=numpy.* ,torch.* ,cv2.* , cv.*"
]


Recorded Error fix:
https://github.com/pytorch/pytorch/issues/701
