Elementwise multiplication for sparse x dense and autograd

Hi, since I cannot find document on the operations for sparse tensors, are there any support on the multiplication for sparse x dense elementwise multiplication? If so, how about the autograd?

Based on my search, there seems not.

Also, I’m working on adjacency matrix, which is 0/1 sparse matrix, usually do not require grad. Except from converting the adjacency matrix to dense, are there some better methods doing that?

1 Like

It’s not supported at the moment.

You could try to use the indices/values of the sparse tensor: for each index, look up the index in the dense matrix, and multiply that value with the value in the values matrix.

Thanks! This is my current workaround, with PyTorch 0.4.0’s advanced indexing, it’s achievable. Thanks for your great work!

1 Like

Could you post your code here? I’m facing out of memory issues for the lookup.