Skip to content

Support Torch.Tensor, Tensorflow and Keras objects in the Variable Explorer #7042

Description

@hgijeon

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)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions