".github/vscode:/vscode.git/clone" did not exist on "d8996b652f8b731a092187c8014c62441d2d9dcf"
partition_utils.py 358 Bytes
Newer Older
1
2
3
from time import time

import dgl
Hongzhi (Steve), Chen's avatar
Hongzhi (Steve), Chen committed
4
5

import numpy as np
6
from dgl import backend as F
7
8
from dgl.transforms import metis_partition

9
10
11
12
13
14
15
16
17

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