torchsparse icon indicating copy to clipboard operation
torchsparse copied to clipboard

Utility functions for transforming DenseTensors into SparseTensors and vice-versa

Open radiradev opened this issue 4 years ago • 1 comments

Hello,

Are there functions to transform data (or/and data batches) from dense format into sparse format, and from sparse format into dense format?

Minkowski Engine has similar functionality: https://nvidia.github.io/MinkowskiEngine/utils.html

Regards

radiradev avatar Jun 29 '21 16:06 radiradev

We don't have utility functions for these. You might use torch.coo_tensor for sparse-to-dense conversion. As for dense-to-sparse conversion, you can first create a meshgrid for the dense vector and then construct SparseTensor.

zhijian-liu avatar Jul 02 '21 22:07 zhijian-liu

TorchSparse v2.1.0 now has support for .dense(). Feel free to check it out!

zhijian-liu avatar Jul 15 '23 01:07 zhijian-liu