Skip to content
Discussion options

You must be logged in to vote

Hi @xiachenrui, in my understanding input_id are not node IDs, but indices to initial seed nodes. Let me give you an example (a slightly modified version of the code available in this tutorial).

import torch
from torch_geometric.data import Data
from torch_geometric.loader import NeighborLoader

x = torch.randn(10, 32)  # Node features of shape [num_nodes, num_features]
y = torch.randint(0, 4, (10, ))  # Node labels of shape [num_nodes]
edge_index = torch.tensor([
    [2, 3, 3, 4, 5, 6, 7, 2, 4],
    [0, 0, 1, 1, 2, 3, 4, 8, 9]],
)

# 8   0  1   9
#  \ / \/ \ /
#   2  3  4
#   |  |  |
#   5  6  7

data = Data(x=x, y=y, edge_index=edge_index)
# nodes from which we will be sampling, taking …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@DamianSzwichtenberg
Comment options

Answer selected by xiachenrui
@xiachenrui
Comment options

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