torch-geometric
Skill by K-Dense-AI
Supports PyTorch Geometric (PyG) graph neural networks, covering node, link and graph classification with common message passing layers. It is for developers building GNNs in torch_geometric.
Install torch-geometric
Built from the published package, never by AI.
git clone --depth 1 https://github.com/K-Dense-AI/scientific-agent-skills /tmp/scientific-agent-skills && mkdir -p ~/.claude/skills && cp -r /tmp/scientific-agent-skills/skills/torch-geometric ~/.claude/skills/torch-geometricRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/K-Dense-AI/scientific-agent-skills /tmp/scientific-agent-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/scientific-agent-skills/skills/torch-geometric ~/.gemini/antigravity-cli/skills/torch-geometricAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill guides an AI assistant through PyTorch Geometric (PyG), a library for graph neural networks built on PyTorch. It covers graph data structures such as Data and HeteroData, the edge_index format, and standard datasets that download and preprocess automatically. It also explains transforms, built-in conv layers such as GCNConv, GATConv, SAGEConv and GINConv, and how to write custom layers with MessagePassing.
The skill includes task patterns for node classification, graph classification, heterogeneous graphs and neighbor sampling. It names the reviewed release, torch-geometric 2.8.0.post1, and the Python and PyTorch versions it requires. It is aimed at developers working with torch_geometric. It is not meant for general NetworkX analytics or non-graph PyTorch models.
Written from the project's SKILL.md and checked against it.
What it can do
- Graph data structuresExplains how to build graphs with Data and HeteroData, including the [2, num_edges] edge_index format.
- Standard datasetsCovers loading datasets such as Planetoid, TUDataset and OGB, with their common tasks.
- TransformsDescribes preprocessing transforms such as NormalizeFeatures, ToUndirected, AddSelfLoops and KNNGraph.
- Built-in GNN layersGuides choice among GCNConv, GATConv, SAGEConv, GINConv, TransformerConv, EdgeConv, RGCNConv and HGTConv.
- Custom message passingShows how to subclass MessagePassing with message, aggregate and update steps.
- Node and graph classificationProvides full-batch node training and mini-batch graph classification patterns with global pooling.
- Heterogeneous graphsCovers HeteroData and lazy channel initialization for heterogeneous models.
- Neighbor samplingMentions neighbor sampling for scalable mini-batch training, which needs pyg-lib or torch-sparse.
What you need
- Python 3.10 or later
- PyTorch 2.9 or later
- torch-geometric 2.8.0.post1
- Network access for installation and dataset or model downloads
- Optional pyg-lib, torch-scatter or torch-sparse wheels matching Python, OS, PyTorch and CUDA/CPU
Try asking
- Build a two-layer GCN for node classification on Cora with PyG
- Convert my edge pairs into a PyG edge_index tensor and validate it
- Write a custom MessagePassing layer in torch_geometric for my graphs
Good to know
- Neighbor sampling needs pyg-lib or torch-sparse, and k-NN operators need pyg-lib in 2.8.
- torch-cluster and torch-spline-conv are deprecated and ignored.
- Conda packages are not provided for Torch versions above 2.5.
- Large datasets were not executed in the source's review; OGB benchmarks need the separate ogb package.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/torch-geometric/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md22 KB -
references/custom_datasets.md10 KB -
references/explainability.md9 KB -
references/heterogeneous.md9 KB -
references/link_prediction.md11 KB
Show all 8 files
-
references/message_passing.md5 KB -
references/review.md7 KB -
references/scaling.md11 KB
Alternatives to torch-geometric
All alternatives →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
Compare with agent-reproduce-align, google_contacts or m06-error-handling
torch-geometric: common questions
Which PyG version does this skill target?
The source reviews torch-geometric 2.8.0.post1 and notes that PyG 2.8 requires PyTorch 2.9 or later. It advises checking the installed release before using new APIs.
Does this skill handle NetworkX analytics or non-graph models?
No. The description says it is not for general NetworkX analytics or non-graph PyTorch models.
Why does edge_index need to be transposed?
PyG expects edge_index as a [2, num_edges] tensor, not a list of tuples. If edges are stored as rows, the source says to transpose them and call .contiguous().
How do I install torch-geometric?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is torch-geometric free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is torch-geometric safe to use?
It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to torch-geometric?
Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.
