assert len(seed_ids) == 1
src, dst, eid = g._graph.in_edges(utils.toindex(seed_ids))
// Test if there is a self loop
self_loop = mx.nd.sum(src.tousertensor() == dst.tousertensor()).asnumpy() == 1
if self_loop:
assert subg.number_of_nodes() == len(src)
else:
After Change
for subg, seed_ids in dgl.contrib.sampling.NeighborSampler(g, 1, 100, neighbor_type="in",
num_workers=4):
assert len(seed_ids) == 1
src, dst, eid = g.in_edges(seed_ids, form="all")
// Test if there is a self loop
self_loop = mx.nd.sum(src == dst).asnumpy() == 1
if self_loop:
assert subg.number_of_nodes() == len(src)