question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support Torch.Tensor in the variable explorer

See original GitHub issue

Problem Description

I’m a pytorch user, and I’m always thinking that type torch.Tensor might be represented in a proper way. What torch.Tensor type data need is just ‘.numpy()’ to be converted to numpy array objects.

So, is it possible to apply simple scripts for the unsupported data types inside of Variable explorer?(i.e. If Variable explorer saw Tensor type objects, then a corresponding function/method for the type is applied and show the result of it on Variable explorer with distinguishable color.)

def type_conversion(data: torch.Tensor):
  if isinstance(data, torch.Tensor):
    return data.numpy()
  return None

Package Versions

  • Spyder: 3.2.8
  • Python: 3.6.4
  • Qt:
  • PyQt:
  • Operating System: macOS 10.13.4

Dependencies

IPython >=4.0    :  6.3.1 (OK)
cython >=0.21    :  0.28.2 (OK)
jedi >=0.9.0     :  0.12.0 (OK)
nbconvert >=4.0  :  5.3.1 (OK)
numpy >=1.7      :  1.14.1 (OK)
pandas >=0.13.1  :  0.22.0 (OK)
psutil >=0.3     :  5.4.5 (OK)
pycodestyle >=2.3:  2.4.0 (OK)
pyflakes >=0.6.0 :  1.6.0 (OK)
pygments >=2.0   :  2.2.0 (OK)
pylint >=0.25    :  1.8.4 (OK)
qtconsole >=4.2.0:  4.3.1 (OK)
rope >=0.9.4     :  0.10.7 (OK)
sphinx >=0.6.6   :  1.7.4 (OK)
sympy >=0.7.3    :  1.1.1 (OK)

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

7reactions
ccordoba12commented, Apr 19, 2021

Sorry, there are not updates about this. We’ll try to do that in the coming months.

1reaction
sanchit88commented, Apr 18, 2021

Hi Spyder team, any update on this matter? Like current developments or even if supporting Pytorch tensors in the debugger and in the variable explorer is a priority? It would be really helpful. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

how see inside object tensor in spyder? - Stack Overflow
I am struggling to see inside an object in a spyder. when I run this snippet, in variable explorer I ...
Read more >
Debugger question about tensor - PyTorch Forums
So I take a look inside the variable explorer: while I can peek inside a dataframe just fine (the “value” column coincides with...
Read more >
PyTorch Development in Visual Studio Code
VS Code provides a Data Viewer that allows you to explore the variables within your code and notebooks, including PyTorch and TensorFlow Tensor...
Read more >
spyder-ide/public - Gitter
I am wondering how can I see inside the tensor object of torch module in spyder? ... should be pretty straightforward to add...
Read more >
Enable PyTorch with DirectML on Windows - Microsoft Learn
The PyTorch-directml package supports only PyTorch 1.13. ... tensor1 = torch.tensor([1]).to(dml) # Note that dml is a variable, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found