Get batch indices from NeighborLoader #4559
-
Hello! I am trying to use NeighborLoader with certain batch size. The code is: train_loader = NeighborLoader(
data,
num_neighbors=[5, 10, 10],
num_workers=32,
input_nodes=data["train_mask"],
batch_size=8
) However, whenever I retrieve a batch, I also need to densify it in a single tensor by calling The issue is that the batches that are coming out of the dataloader don't have the batch indices tensor that allows me to assign each node to its own batch. That is, if I do Am I missing something here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The |
Beta Was this translation helpful? Give feedback.
The
NeighborLoader
will construct a single computation graph for all nodes within your mini-batch, it will not create a isolated subgraphs for each central node. I suggest to take a look into theShaDowKHopSampler
in PyG which does exactly this :)