项目文件夹

文件
xiang song(charlie.song) 4f7bd0d0fb [Example] Cluster Sage for ogb (#1850)
* Cluster-Sage

* Fix

Co-authored-by: Ubuntu <ubuntu@ip-172-31-34-186.ec2.internal>
Co-authored-by: Zihao Ye <expye@outlook.com>
2020-08-03 00:04:05 +08:00

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