Sparse tensor multiply a diagonal tensor


I would like to multiply a (symmetric) sparse tensor with a diagonal tensor. Since both tensors are sparse and the output is also sparse, I expect that this can be done very efficiently. However, my current solution use and I have to convert one of tensor to be dense, which is not very memory efficient.

Do you have some good suggestions? Thank you!

Sparse matrix multiplication doesn’t seem to be implemented yet as seen in this feature request, so I assume you would have to use a dense matrix for one tensor.

Thank you. I end up transferring the tensor to cpu and use scipy.sparse to do the job. Hope there will be more features to support common sparse tensor computation.