A PyTorch Geometric Data object packages one graph and its associated attributes, including node features, labels, connectivity, and train/test masks. Use it for graphs created from preprocessing pipelines or generated directly before batching. section 8.3.4
Build a graph object by assembling:
- Optional custom attributes when the graph needs additional node-, edge-, subgraph-, or graph-level data. section 8.3.4
Creating a social-network graph
Convert a NetworkX graph or indexed edge list into tensors, then construct Data(x=x, y=y, edge_index=edge_index, train_mask=train_mask, test_mask=test_mask). Store multiple Data objects in a list and pass them to DataLoader for batching.
