Code hinting in pycharm for pytorch is not good,why?

My pycharm(2018.1.3) can not hint well for pytorch 0.4.0, my system is windows


What do you exactly mean with not good? I am on MacOS and I have no problems at all.

I am on MacOS, auto-complete does not work for me too.
I do but pycharm can not hint any thing with pytorch.

I believe this is referring to the same problem as here. And the related GitHub issue here.

Alright, first of all which python version are you using 2.7 or 3.0+? Remember if you are using Python 3.0+ you should install pytorch via pip3 and not pip.

If you go to your Project Inspector (the thing with the file hierarchy on the left), there should be another hierarchy called External Libraries > Binary Skeletons > torch. If this is the case, autocomplete should work correctly.

If not, make sure to connect torch properly to your PyCharm python directory.

@string111: Which version of PyTorch are you referring to? 4.0? And your PyCharm recognizes torch.tensor as being callable (note, lowercase tensor, not Tensor)? My binary skeletons also list torch, but many of the functions are not in skeleton (hence, the problem discussed here), tensor being one of them. Note, most of the PyTorch functions do autocomplete/are recognized, but a large number are missing.

Doesn’t recognize it is callable, you are right. But autocompletes it. Im using Torch 0.4.0