dgl.partition_graph_with_halo
- dgl.partition_graph_with_halo(g, node_part, extra_cached_hops, reshuffle=False)[source]
对图进行分区。
根据给定的每个分区的节点分配,该函数将输入图分割成子图。子图可能包含HALO节点,这些节点不属于子图的分区,但在固定的跳数内连接到分区中的节点。
If reshuffle is turned on, the function reshuffles node IDs and edge IDs of the input graph before partitioning. After reshuffling, all nodes and edges in a partition fall in a contiguous ID range in the input graph. The partitioend subgraphs have node data ‘orig_id’, which stores the node IDs in the original input graph.
- Parameters:
- Returns:
DGLGraphs的字典 – 键是分区ID,值是分区的DGLGraph。
Tensor – 如果‘reshuffle=True’,则存储重新洗牌后的节点ID与原始节点ID之间映射的一维张量。否则,返回None。
Tensor – 如果‘reshuffle=True’,则存储重新洗牌后的边ID与原始边ID之间映射的一维张量。否则,返回None。