Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How the malmul works in this library? #393

Open
pigu163 opened this issue Dec 11, 2024 · 0 comments
Open

How the malmul works in this library? #393

pigu163 opened this issue Dec 11, 2024 · 0 comments

Comments

@pigu163
Copy link

pigu163 commented Dec 11, 2024

Hi, I am using pytorch_sparse matmul, but see abnormal result

from torch_sparse import SparseTensor, matmul

x [batch, features, nodes, step]

x = torch.rand(100, 20, 3, 24)
adj = torch.eye(100,100)
adj = SparseTensor.from_dense(adj)
out = adj.matmul(x) --> torch.Size([100, 20, 100, 24])

@rusty1s
Generally, sparse matrix (100, 100), it can't directly multiply with the (3, 24) dimensions because the dimensions don't align properly for matrix multiplication, but there is no error pop up. If this operator same as torch.matmul, and also follow their broadcast rules, it shouldn't be like this.
Is there any explanation for this operator ?

Beside, torch.matmut has bug on broadcast sparse.matrix times dense.matrix since torch verison >= 2.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant