-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Added PyTorch Sparse Tensor support for remove_self_loops, add_self_loops, and maybe_num_nodes
#6847
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6847 +/- ##
==========================================
- Coverage 91.74% 91.50% -0.24%
==========================================
Files 427 427
Lines 23173 23076 -97
==========================================
- Hits 21259 21116 -143
- Misses 1914 1960 +46
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
| assert out[0].tolist() == expected | ||
| assert out[1].tolist() == [[1, 2], [3, 4]] | ||
|
|
||
| adj = to_torch_coo_tensor(edge_index) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to_troch_coo_tensor returns a sparse torch.Tensor. It would be nice to add a test for SparseTensor too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean to add tests with torch_sparse.SparseTensor as input for these functions as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually skip that. I guess we only want to support sparse torch.Tensor here, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly.
This PR aims to add PyTorch Sparse Tensor support for
remove_self_loops,add_self_loops, andmaybe_num_nodes, which will be used for supporting PyTorch Sparse Tensor intorch_geometric.nn.conv, e.g.AGNNConv:pytorch_geometric/torch_geometric/nn/conv/agnn_conv.py
Lines 65 to 69 in 09dbb20
There are some questions to be clarified:
add_remaining_self_loops?