Search code examples
pythonnumpymatlabpytorchpycharm

Good way to view matrices and higher dimensional arrays in VScode


When working with PyTorch/numpy and similar packages, is there a good way to view matrices (or, in general, arrays with two or more dimensions) in debug mode, similar to the way Matlab (or even pyCharm if I remember correctly) present it? This is, for example, a PyTorch tensor, which is very confusing -- opening H here gives me the same thing again and again. PyTorch Tensor

As opposed to Matlab, where I can watch it like that: Matlb array

Would appreciate any help with that!


Solution

  • Yes, make sure you have the Jupyter extension installed and then simply right click the variable in the Debug menu and select the View Value in Data Viewer option.