Change debugger info of pytorch tensor from value to shape #1199
Replies: 3 comments 1 reply
-
We use However, if that is not feasible, it can be special-cased. Can you tell more about the scenario, and why one representation is superior to the other here? |
Beta Was this translation helpful? Give feedback.
-
I find some issues in pytorch repo about this, like pytorch/pytorch#63855 and pytorch/pytorch#35071. Seems like there are already many people ask for this feature, but pytorch does not do this, as those two issues have been stable for two or three years. I leave some commets on them, but I'm pessimistic about this. Therefore, let's make this special-cased. First, when we are debugging some pytorch code, there maybe some error in that code, which are almost caused by wrong shape. For example, a fc layer (technically matrix multiply) will raise error when A(3*4 matrix) @ B(5*4 matrix). If vscode display the shape info of those two tensor, we can fix this by [email protected] immediately. But if vscode display some thing like Second, we init network randomly or load pre-train checkpoint, most of the time. So the value of network's weight is just random or meanless to human. In fact, not just network's weight, almost all of tensors except just some input tensor are random or meanless. On the other hand, if we want to check whether the value of tensor is correct or not, we check the loss or metrics indirectly or display some heat map to visualize them instead of check the value directly. For now, vscode display the value of tensor when debug, It looks like: |
Beta Was this translation helpful? Give feedback.
-
I tempory use this but I strongly suggest vscode to support it natively |
Beta Was this translation helpful? Give feedback.
-
Now, in debuger we display the value str of pytorch tensor, which is meanless mostly. How about change this to the shape of pytorch tensor? It will be more helpful.
Beta Was this translation helpful? Give feedback.
All reactions