Install any skill in seconds. Free to start, no credit card required.
Get Started Free →mkurman/torch-geometric
Guide for building Graph Neural Networks with PyTorch Geometric (PyG).
Passed 21 of 22 test cases with the skill, and 19 of 22 without it.
2 fixed19 passed either way1 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
I am implementing a custom Graph Convolution layer subclassing PyTorch Geometric's MessagePassing class. I want my message() function to receive source node features for each directed edge. A junior developer suggested using x_src in the parameter signature. Write a code snippet showing how to define message() and explain how PyG's variable suffix naming convention automatically passes source node features.
| Checked | Without skill | With skill |
|---|---|---|
| Uses the _j suffix on feature variables like x_j in the message() signature to access source node features | Missed | Passed |
| Refers to target or central node features using the _i suffix in message passing | Passed | Passed |
The instructions your model reads when the skill loads.
-|----------|----------|
| GCNConv | Homogeneous, semi-supervised node classification | Spectral-inspired, degree-normalized aggregation |
| GATConv / GATv2Conv | When neighbor importance varies | Attention-weighted messages |
| SAGEConv | Large graphs, inductive settings | Sampling-friendly, learnable aggregation |
| GINConv | Graph classification, maximizing expressiveness | As powerful as WL test |
| TransformerConv | Rich edge features, complex interactions | Multi-head attention with edge features |
| EdgeConv | Point clouds, dynamic graphs | MLP on edge features (x_i, x_j - x_i) |
| RGCNConv | Heterogeneous with many relation types | Relation-specific weight matrices |
| HGTConv | Heterogeneous graphs | Type-specific attention |
All conv layers accept (x, edge_index) at minimum. Many also accept edge_attr for edge features.
Use -1 for input channels to let PyG infer dimensions automatically — especially useful for heterogeneous models:
conv = SAGEConv((-1, -1), 64) # Input dims inferred on first forward pass
# Initialize lazy modules:
with torch.no_grad():
out = model(data.x, data.edge_index)
For common architectures, PyG provides ready-made model classes:
from torch_geometric.nn import GraphSAGE, GCN, GAT, GIN
model = GraphSAGE(
in_channels=dataset.num_features,
hidden_channels=64,
out_channels=dataset.num_classes,
num_layers=2,
)
test cases passed, vs 19 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.