spektral.utils.reorder(edge_index, edge_weight=None, edge_features=None)
edge_features according to the row-major
edge_index: np.array of shape
[n_edges, 2](representing rows and columns of the adjacency matrix), indices to sort in row-major order.
edge_weight: np.array or None, edge weight to sort according to the new order of the indices.
edge_features: np.array or None, edge features to sort according to the new order of the indices.
- edge_index: np.array, edge_index sorted in row-major order.
- edge_weight: If edge_weight is not None, edge_weight sorted according to the new order of the indices. Otherwise, None.
- edge_features: If edge_features is not None, edge_features sorted according to the new order of the indices. Otherwise, None.
Converts a Scipy sparse matrix to a SparseTensor. The indices of the output are reordered in the canonical row-major ordering, and duplicate entries are summed together (which is the default behaviour of Scipy).
x: a Scipy sparse matrix.