Oh, right. Factory method torch.sparse_coo_tensor must be the one I wanted.
I found on https://pytorch.org/docs/stable/sparse.html 9 that some sort of hybrid sparse+dense tensors are supported, but I didn’t understand the format yet and if they are of help in this usecase. Do you know if those “hybrid” tensors are the “hybrid” tensors needed in this case?
About bitsets - yes, I’ll add this usecase to my feature request: https://github.com/pytorch/pytorch/issues/32867 2
I thought that even if I implement bitset compression, uncompression in a practical way would still be reconstruct the indices tensor and still construct the sparse tensor and then call to_dense().