Skip to content
Discussion options

You must be logged in to vote

You can modify graphs in Dataset through the transform/pre_transform interface. For how to add new nodes, take a look at, e.g., the VirtualNode transform. In general, it is as simple as

data.edge_index = torch.cat([data.edge_index, torch.tensor(new_edges)], dim=1)
data.x = torch.cat([data.x, new_features], dim=0)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by simon-forb
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