rusty1s / pytorch_sparse

PyTorch Extension Library of Optimized Autograd Sparse Matrix Operations
MIT License
1.01k stars 147 forks source link

Sparse Bilinear map #369

Closed Xparx closed 4 months ago

Xparx commented 7 months ago

Hey,

I'm trying to implement a custom attention mechanism. Is there a function or a efficient way to implement a bilinear mapping in pytorch_sparse?

rusty1s commented 7 months ago

Can you clarify what you wan to do exactly?

Xparx commented 7 months ago

I wanted to try to do the same as in the pytorch bilinear module, when A is a sparse matrix.

Xparx commented 7 months ago

As far as I understand pytorch_sparse works on 2d tensors so might not be relevant exactly. I might need to think this one over a bit.

rusty1s commented 7 months ago

torch-sparse can handle more than 2 dimensions (but only the first two can be sparse). Would that be sufficient in your case?

Xparx commented 4 months ago

Hey, Sorry for the slow response. I think my problem and my understanding of what is being computed doesn't make sense. I manage to use torch-sparse for the sparse computations I needed. I'm going to close this issue for now.

Thanks for the great library!