pyg-team / pytorch_geometric

Graph Neural Network Library for PyTorch
https://pyg.org
MIT License
21.42k stars 3.68k forks source link

Functionality to convert a [N, M] adjacency matrix to a [2, num_messages] edge_index #9655

Closed kleingeo closed 1 month ago

kleingeo commented 2 months ago

🚀 The feature, motivation and pitch

Simple functionality, or even documentation, to convert a (dense) [N, M] adjacency matrix to a (dense) edge_index.

Alternatives

No response

Additional context

No response

rachitk commented 2 months ago

Does the dense_to_sparse function meet the criteria of what you need?

https://pytorch-geometric.readthedocs.io/en/latest/modules/utils.html#torch_geometric.utils.dense_to_sparse