Skip to content
Advertisement

How to convert a PyTorch sparse_coo_tensor into a PyTorch dense tensor?

I create a sparse_coo tensor in PyTorch:

JavaScript

Now I want to convert a PyTorch sparse tensor into a PyTorch dense tensor. Which function can be used?

Advertisement

Answer

you can use to_dense as suggested in this example :

JavaScript

And by the way, the documentation is here

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement