Agent skill · software engineering · k-dense-ai
torch-geometric
PyTorch Geometric (PyG) for graph neural networks — node/link/graph classification, message passing (GCN, GAT, GraphSAGE, GIN), heterogeneous graphs, neighbor sampling, and custom datasets. Use when working with torch_geometric, not for general NetworkX analytics or non-graph PyTorch models.
Why this skill is useful
Provides domain-specific knowledge on implementing graph neural networks with PyTorch Geometric, including custom dataset handling and message passing techniques.
What it needs
Requires torch, torch_geometric installed locally. About 9k tokens when loaded. Last updated 2026-08-03. 32,849 stars on the source repository.
What this skill does
PyTorch Geometric (PyG) PyG is the standard library for Graph Neural Networks built on PyTorch. It provides data structures for graphs, 60+ GNN layer implementations, scalable mini-batch training, and support for heterogeneous graphs. Installation Tested against torch-geometric 2.7.x (Oct 2025). Requires Python 3.10+ and PyTorch 2.6+. Optional accelerated ops (pyg-lib, torch-scatter, torch-sparse, torch-cluster) are not required for basic PyG usage (since PyG 2.3). Install version-matched wheels from the PyG wheel index after checking your PyTorch and CUDA versions: Check your version: Conda: the pyg conda channel is no longer maintained for PyTorch >2.5 — use uv pip install and the wheel index above instead. PyG 2.7 notes PyG 2.7 dropped Python 3.9 and PyTorch ≤2.5. See the 2.7.0 release notes for PyTorch 2.6–2.8 compatibility tables. torchgeometric.distributed is deprecated — use standard torch.distributed DDP (see references/scaling.md). Core Concepts Graph Data: Data and HeteroData A graph lives in a Data object. The key attributes: edgeindex format is critical: it's a [2, numedges] tensor where edgeindex[0] = source nodes, edgeindex[1] = target nodes. It is NOT a list of tuples. If you have edge pairs as rows, transpose and call .contiguous(): For undirected graphs, include both directions: edge (0,1) needs both [0,1] and [1,0] in edgeindex. For heterogeneous graphs, use HeteroData — see the Heterogeneous Graphs section below. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills k-dense-ai/torch-geometric