How can vscode view detailed usage information for certain python package library functions? (like the sum function in pytorch)?

Viewed 123

I used to use spyder-IDE for python programming, for example, I used the sum function in pytorch library, torch.sum(), using keyboard shortcut "ctrl+I" to quickly see how to use the function, input and output parameters, examples code and so on. However, with the latest pylance_v2021.9.1+vscode 1.6+pytorch 1.9 you cannot see the detailed help information, it seems that you can only see it by typing torch.sum()? in the terminal, Is there some extensions that provides this feature? Thank you!

Official vscode says (IntelliSense through the Pylance language server) that use pylance+pytorch 1.8.1 or later release support mouse hover to see pytroch detailed preview information, but I use the latest version of vscode 1.6+pytorch 1.9 but it doesn't work, it only shows function signature hints, not detailed help information.

  • 2021.9.17 update, Description example update:

This image is the detailed help information of "torch.sum" obtained by spyder-IDE enter image description here

However, it is not easy to get such detailed help information in vscode, but only the function signature shown below(left), unless you type torch.sum? in the python interactive window to see the full help information every time(right). Moreover, the full "Docstring" is not rendered, so it is not easy to read visually like spyder-IDE. enter image description here

The above two use the same python environment,the various versions used are: vscoder1.6+pytorch1.9+(microsoft)python_v2021.9.1230869389+pylance_v2021.9.2, spyderIDE4.0

1 Answers

Have you click this?

enter image description here

Then it should be like this:

enter image description here

the sum would be like this:

enter image description here

But if you want to get more information, it depends on the docs, such as AdaptiveAvgPool2d:

enter image description here

But the sum does not contains that:

enter image description here

Related