New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
namespaces torch.cuda, torch.device missing from pyi #16996
Comments
torch.device() torch.tensor() are still missing, I believe they are much frequently used. |
torch.randn() and torch.FloatTensor() are still missing in PyTorch 1.0.1, related to vs code and wing ide |
|
torch.from_numpy()、torch.ones are still missing in 1.0.1.post2,related to Pycharm。 |
@Wenlong-Shi I'd say |
@fmassa |
torch.no_grad() is also missing in in 1.0.1.post2, related to Pycharm |
torch.cuda()、torch.utils is also missing in in 1.0.1, related to Pycharm |
I'd be happy to manually add the stubs for some of these missing namespaces and submit those as a PR. Would that be acceptable, or are you looking for a more automatic codegen approach? |
Thank you for offering to work on these! I'm not sure whether there / what the are plans for a maintenance release, but a great first step would to fix these in master / the nightlies.
|
I am using can't find reference
not callable
|
Maybe better to just open a new issue with the things are still missing from the stubs. |
I went ahead and opened new issues for |
I have updated to the latest version (1.1.0). However, this bug is still not fixed. |
What specifically do you mean by 'this bug'? Like, which methods? I did a fresh install of 1.1.0 and all the new type stubs have seemingly been installed correctly. |
can't find reference in 1.1.0, some examples:
|
|
@bcrchzz |
What still cannot find the reference now is |
@lianghongzhuo Both my pytorch and pycharm are in the latest version. |
Besides, I find more functions, |
As @lianghongzhuo says, the type stubs for |
@malmaud Thank you a lot. I re-configured the python interpreter in the PyCharm Preference and reopened it. And the problem solved. Thanks again for your great jobs. |
@bcrchzz I also use a remote interpreter. How did you reconfigure the remote interpreter? I removed it and re-added it but still have the reference problems. Also: did you install pytorch from root, conda or pip? |
I get errors for |
For me torch.log, torch.stack, torch.exp, torch.randn, torch.empty and torch.FloatTensor do not work yet on 1.1.0 installed from pypi. |
I think there's no doubt that the stubs of the |
Using torch v1.1.0 and VSCode v1.33.1 (latest) with python 3.6.7, pretty much all torch.* methods do not show up (including all posted by the @imyhxy further up), nor is torch.tensor callable. It works fine in pycharm (apart from the callability of torch.tensor). |
I found that the stubs of torch.* works well in pycharm python console, but still cannot find reference in the editor. Even I reinstall pycharm as well as remote python interpreter. So confusing. |
🐛 Bug
Auto-complete / type information for torch.cuda / torch.device are missing, as reported at #7318 (comment)
To Reproduce
Auto-complete
torch.cuda.<TAB>
in pycharmThe text was updated successfully, but these errors were encountered: