Open source

PyTorch Geometric

Quick explainer2 min readAdvanced

PyTorch Geometric (PyG) is an open-source library built on PyTorch for writing and training graph neural networks, which learn from data made of connected points.

In plain words

Some data is a network rather than a grid or a sentence: people who follow each other, atoms bonded in a molecule, roads between towns. A graph stores the things as nodes and the links as edges. PyG gives you a standard way to store graphs, ready-made graph neural network layers from published research, mini-batch loaders for many small graphs or one huge graph, and common benchmark datasets. It also handles 3D meshes and point clouds.

A quick example

The PyG introduction builds a tiny undirected graph of three nodes joined by four edges, where each node carries one number. You store the edges as a pair of lists saying which node links to which, wrap everything in a Data object, and can then pass it through a graph neural network layer.

Where you'll meet it

  • Training on many small graphs or one giant graph.
  • Graph learning research with common benchmark datasets.
  • 3D meshes and point clouds.

Related

Sources

  1. DocsPyG Documentation, PyG · read 29 Sept 2026
  2. DocsIntroduction by Example, PyG documentation · read 29 Sept 2026

Checked by WhatIsAI against the sources above · 29 Sept 2026. Spotted an error? Report it.