rballester / tntorch

Tensor Network Learning with PyTorch
https://tntorch.readthedocs.io/
GNU Lesser General Public License v3.0
283 stars 42 forks source link

How do I see the tensor data after decomposition? #26

Closed GlazeDonuts closed 3 years ago

GlazeDonuts commented 3 years ago

Consider, a = torch.randn(2, 3, 4) b = tn.Tensor(a, ranks_cp=2)

If I want to view the values of the approximated tensor b, how do I do that? Can I get a numpy array or torch tensor like a? Since I need to perform operations like element-wise subtraction between the true tensor and approximated one.

Aelphy commented 3 years ago

You can call b.torch()

GlazeDonuts commented 3 years ago

Thanks a lot :)