Skip to content
Discussion options

You must be logged in to vote

You can use the batch_size in the data object returned by the loader, the first batch_size nodes will be in input_nodes.

loader = NeighborLoader(data,num_neighbors=[args.sampling_neighbor_size] * 2,
shuffle=True,input_nodes=split_idx['train'],batch_size=args.batch_size)
data_batch = next(iter(loader))
data_batch.x[:data_batch.batch_size] # contains only features of nodes in input_nodes

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@LuisaWerner
Comment options

@wsad1
Comment options

@LuisaWerner
Comment options

@wsad1
Comment options

@LuisaWerner
Comment options

Answer selected by LuisaWerner
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