torch-geometric
Graph Neural Network Library for PyTorch
What it is and what it does
PyTorch Geometric is a framework for implementing Graph Neural Networks on top of PyTorch. It provides a collection of pre-built GNN layers (GCNConv, GraphSAGE, GAT, etc.), a message-passing API for custom architectures, mini-batch loaders for both small and large graphs, and benchmark datasets. The library is designed to feel like native PyTorch—if you know PyTorch, the API is straightforward.
You use it to solve problems on graph-structured data: node classification, link prediction, graph classification, and other geometric deep learning tasks. It handles diverse graph types including static graphs, dynamic graphs, heterogeneous graphs with multiple node and edge types, and 3D point clouds. The library supports multi-GPU training and torch.compile for performance optimization.
Use it for:
- Classify nodes in citation networks or social graphs using pre-built GCN or GraphSAGE layers.
- Build custom GNN architectures by extending the MessagePassing base class for research or domain-specific problems.
- Train on large-scale graphs with millions of nodes using mini-batch loaders and scalable GNN models.
- Perform link prediction or graph-level classification on benchmark datasets (OGB, Cora, Citeseer, etc.).
- Process 3D point cloud data or mesh structures using geometric transformations and specialized layers.
- Prototype heterogeneous graph models with multiple node and edge types for knowledge graphs or recommendation systems.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyTorch Geometric is a library for building and training Graph Neural Networks (GNNs) on structured data, providing pre-built GNN layers, datasets, data loaders, and utilities for geometric deep learning.
Yes. PyTorch Geometric is production-stable (Development Status 5), actively maintained, has no known vulnerabilities, and is in the top 5000 PyPI packages by download volume. Install friction is low and the MIT license is permissive. It is the standard library for GNN work in PyTorch—install it if you need to build or train graph neural networks.
Install
torch-geometric on PyPI
pip
pip install torch-geometricuv
uv add torch-geometricpoetry
poetry add torch-geometricInstalling torch-geometric
Before you install
Low friction install with a pure Python wheel. Active maintenance—last commit 2026-07-31, release 25 days ago. Supports Python 3.10 through 3.14. Nine runtime dependencies are all well-established packages (numpy, torch, aiohttp, requests, tqdm, etc.), so no unusual compatibility risks.
License in practice
MIT license (permissive). You can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions—just include the license notice.
Quickstart
pip install torch-geometric
import torch
from torch_geometric.nn import GCNConv
from torch_geometric.datasets import Planetoid
dataset = Planetoid(root='.', name='Cora')
model = GCNConv(dataset.num_features, dataset.num_classes)
PyTorch must be installed separately (not listed as a direct dependency in the fact sheet, but is the core runtime requirement). Requires Python >=3.10.
Verify before relying
- Whether PyTorch is declared as a dependency in the actual package metadata (not shown in the runtime list).
- GPU/CUDA support requirements and whether optional compiled extensions (pyg-lib) are automatically built or require system libraries.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 9 — aiohttp, fsspec, jinja2, numpy, psutil, pyparsing, requests, tqdm, xxhash |
| Maintenance | actively maintained — 25 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,517,719/month — #3,821 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: torch_geometric-2.8.0.post1-py3-none-any.whl
Keywords: deep-learning, pytorch, geometric-deep-learning, graph-neural-networks, graph-convolutional-networks
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
ogbOGB provides standardized benchmark datasets,…
permissive · top 15,000 on PyPI
pytorchcvProvides a collection of pretrained computer…
unclear · top 15,000 on PyPI
cuequivariance-torchPyTorch bindings for NVIDIA's CUDA-accelerated…
permissive · top 15,000 on PyPI
e3nne3nn provides PyTorch-based operations for…
permissive · top 15,000 on PyPI
jraphJraph provides data structures and utilities…
permissive · top 15,000 on PyPI
torchinfoGenerates detailed summaries of PyTorch neural…
permissive · top 15,000 on PyPI
pnnxExports and converts PyTorch neural network…
permissive · top 15,000 on PyPI
torch-complexProvides a Python class wrapping real and…
permissive · top 15,000 on PyPI
segmentation-models-pytorchProvides PyTorch-based neural network models…
permissive · top 15,000 on PyPI