Open malmaud opened 5 years ago
@malmaud could you please check if it is working with older version of VSC or older versions of pytorch.
To be honest, I might not have time to do that in the short term (ie next month or two).
I can say that what matters is the version of the Python language server that VSCode is using, not the version of VSCode itself - the VSCode Python extension periodically downloads a new version of the Python language server independently of the VSCode version.
In terms of versions of PyTorch, it's definitely related to the introduction of type stubs, although I'm not exactly sure which stub file is triggering the VSCode bug.
Also it would be a good idea for people to upvote https://github.com/microsoft/python-language-server/issues/1301 to show the Microsoft team that there is interest in having this resolved upstream.
Visual Studio Code is not providing autocomplete suggestions for (at least) the
nn
andoptim
submodules as of PyTorch 1.2, despite the type stubs for them being valid (as shown by mypy making correct use of them).This seems to be an upstream bug with Microsoft's Python language server implementation, https://github.com/microsoft/python-language-server/issues/1301.