Dgl.pull but only from some nodes with importance sampling

Hello all,

Say, I have a set S of nodes and I want to do layer-wise importance sampling from the set R \ S, where R is the set of nodes that has edges to nodes in S, so that when I pull from S, I don’t pull from every vertex in R. How can I accomplish in dgl efficiently?


If you determined the neighbors to pull from when pulling S (say your set is denoted T), I can think of either
(1) Finding the edge IDs between S and T using g.edge_ids(), then use send_and_recv() with those edge IDs, or
(2) Inducing a subgraph, for instance with node_subgraph.