MCPcopy
hub / github.com/dmlc/dgl / from_csr

Function from_csr

python/dgl/graph_index.py:1094–1116  ·  view source on GitHub ↗

Load a graph from CSR arrays. Parameters ---------- indptr : Tensor index pointer in the CSR format indices : Tensor column index array in the CSR format direction : str Returns ------ GraphIndex The graph index the edge direction. Ei

(indptr, indices, direction)

Source from the content-addressed store, hash-verified

1092
1093
1094def from_csr(indptr, indices, direction):
1095 """Load a graph from CSR arrays.
1096
1097 Parameters
1098 ----------
1099 indptr : Tensor
1100 index pointer in the CSR format
1101 indices : Tensor
1102 column index array in the CSR format
1103 direction : str
1104
1105 Returns
1106 ------
1107 GraphIndex
1108 The graph index
1109 the edge direction. Either "in" or "out".
1110 """
1111 indptr = utils.toindex(indptr)
1112 indices = utils.toindex(indices)
1113 gidx = _CAPI_DGLGraphCSRCreate(
1114 indptr.todgltensor(), indices.todgltensor(), direction
1115 )
1116 return gidx
1117
1118
1119def from_shared_mem_graph_index(shared_mem_name):

Callers 1

from_scipy_sparse_matrixFunction · 0.70

Calls 1

todgltensorMethod · 0.80

Tested by

no test coverage detected