Skip to content
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

Display order of properties of a tensor object in debugging #1525

Open
Jesbong opened this issue Feb 27, 2024 · 7 comments
Open

Display order of properties of a tensor object in debugging #1525

Jesbong opened this issue Feb 27, 2024 · 7 comments

Comments

@Jesbong
Copy link

Jesbong commented Feb 27, 2024

Can I adjust the display order of properties of a tensor object when debugging Python in vscode? Because in deep learning, we focus more on the shape of a tensor rather than specific values. Now we want to see the value of a tensor by pulling it down a long distance. This has reduced my debugging efficiency.

@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Feb 27, 2024
@int19h
Copy link
Contributor

int19h commented Feb 27, 2024

We don't officially support this, but I believe you could author a pydevd extension to customize the representation for your type - have a look at https://github.com/microsoft/debugpy/tree/main/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions. Note however that we will be moving away from pydevd in the future.

However, given that ML/AI is a particularly important scenario these days, I'd love to hear more about the nature of customizations in question, so that we can properly address this in our new debugger.

@Jesbong
Copy link
Author

Jesbong commented Feb 27, 2024

The shape(dimension) of a tensor in vscode is far away from the top. Frequent need to expand and view results in low efficiency.

v2-d26e166332f23874578a00156232284e_r

And pycharm can see the type and shape without opening the variable, as shown in the figure. We are very concerned about the dimensions of tensors in ML/AI, it's so convenient.

pycharm

@Jesbong
Copy link
Author

Jesbong commented Feb 27, 2024

I believe the following issue are all about the same thing. The shape of numpy and tensor is so important for debuger in ML/AI.

#1191
pytorch/pytorch#35071
pytorch/pytorch#63855
microsoft/vscode-python#14244

@54nzg
Copy link

54nzg commented Apr 8, 2024

The shape of a variable cannot be easily viewed.Whether mouse hover will be supported in the future to see the shape of the variable.

@makaspacex
Copy link

It is obvious that everyone is very satisfied with the debugging of pycharm. If there are no patents or other restrictions, you can copy the display stype and information of pycharm. If there are restrictions, ignore my comments pls.

@makaspacex
Copy link

In addition to tensor and numpy, pycharm also has good type display support for list, tuple, dict, etc.

@haduoken
Copy link

haduoken commented May 9, 2024

I tempory use this
https://stackoverflow.com/questions/70704619/is-it-possible-to-show-variable-shapes-and-lengths-in-vscode-python-debugger-jus

image

but I strongly suggest vscode to support it natively

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants