0

I'm using torch_geometric.

The adjacency matrix is in numpy format like:

adj = np.array([[0, 1, 0],[1, 0, 0],[0, 0, 0]])

How can I get the parameter edge_attr from the adjacency matrix?

  • Can you provide a more detailed explanation of what you are trying to do? – Ivan Jun 30 '22 at 10:34
  • You may want to review this: It converts a scipy sparse matrix to edge indices and edge attributes, link: https://pytorch-geometric.readthedocs.io/en/latest/_modules/torch_geometric/utils/convert.html#from_scipy_sparse_matrix Is this the answer you were looking for? – joe hoeller Jun 30 '22 at 17:19
  • Does this answer your question? [Pytorch Geometric sparse adjacency matrix to edge index tensor](https://stackoverflow.com/questions/69091074/pytorch-geometric-sparse-adjacency-matrix-to-edge-index-tensor) – ndrwnaguib Oct 10 '22 at 22:19

0 Answers0