dmlc--dgl
4f7bd0d0fb
* Cluster-Sage * Fix Co-authored-by: Ubuntu <ubuntu@ip-172-31-34-186.ec2.internal> Co-authored-by: Zihao Ye <expye@outlook.com>
17 行
356 B
Python
17 行
356 B
Python
from time import time
|
|
|
|
import numpy as np
|
|
|
|
import dgl
|
|
from dgl.transform import metis_partition
|
|
from dgl import backend as F
|
|
|
|
def get_partition_list(g, psize):
|
|
p_gs = metis_partition(g, psize)
|
|
graphs = []
|
|
for k, val in p_gs.items():
|
|
nids = val.ndata[dgl.NID]
|
|
nids = F.asnumpy(nids)
|
|
graphs.append(nids)
|
|
return graphs
|