Adding custom sparsity support


I am working on a project regarding sparse neural network inference (maybe training). Throughout this process I realized that many sparse kernel libraries are only provided at the c++ level. For example, I cannot have an nn.Linear module that performs the matrix multiplication with my specified sparse backend. Correct me if I am wrong (much appreciated).

As a result, I decide to make it happen. Although having been a fervent pytorch advocate, I have never touched any c+= stuff. It has alway been writing new modules, new optimizer or new learning_rate schedulers. Just wondering if anyone here has done something similar before and is open to share the experience. Any help is much appreciated. Thank you and have a good one