gammagl.utils.to_scipy_sparse_matrix

class to_scipy_sparse_matrix(edge_index, edge_attr=None, num_nodes=None)[source]

Converts a graph given by edge indices and edge attributes to a scipy sparse matrix.

Parameters:
  • edge_index – The edge indices.

  • edge_attr (tensor, optional) – Edge weights or multi-dimensional edge features. (default: None)

  • num_nodes (int, optional) – The number of nodes, i.e. max_val + 1 of index. (default: None)