Skip to content
Discussion options

You must be logged in to vote

It is important to note that neighborhood sampling will re-map the global node indices to local indices of the sampled subgraph. If you wanna restore this mapping, you can do

data.n_id = torch.arange(data.num_nodes)

loader = NeighborLoader(data, ...)

batch = next(iter(loader))
edge_index = batch.n_id[batch.edge_index]

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@HacksonJohn
Comment options

Answer selected by HacksonJohn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants