Cpp torch.sparse usage?

Is there any way to use torch.sparse.mm() in the cpp api? I have been aimlessly wandering through the source code trying to find a way and am not getting very far.

I am currently implementing a 2d convolution with sparse weights and dense input, and find that batch-wise computing is too slow with python loops (hence my cpp use).

The unit tests could be a good starter showing how sparse methods can be used in the C++ backend, e.g. at::sparse_sampled_addmm.

1 Like