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)
| 1092 | |
| 1093 | |
| 1094 | def 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 | |
| 1119 | def from_shared_mem_graph_index(shared_mem_name): |
no test coverage detected