Problems when use 'to_scipy_sparse_matrix' #4284
-
Dear pyg uesrs, Below is an example of a my graph And my code is that
The edge_index and edge_attr after laplacian have But I got the error code at
But, in pyg document, it is described that edge_attr (Tensor, optional) – Edge weights or multi-dimensional edge features. (default: None) Could you tell me what I'm missing...? Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
L1 = to_scipy_sparse_matrix(edge_index, edge_attr[:, 0]).tocsc()
L2 = to_scipy_sparse_matrix(edge_index, edge_attr[:, 1]).tocsc() |
Beta Was this translation helpful? Give feedback.
scipy
can only hold one-dimensional edge features inside its sparse matrices. As such, you would need to create two matrices (one for each edge feature):