OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

Graph Transformer Pytorch

Graph Transformer Pytorch is a Python library implementing a PyTorch graph transformer that updates node and edge features, with an option to accept an adjacency matrix.

Independent OpenViST project profile, based on linked sources.

Graph Transformer Pytorch — Projects that already use PyTorch and need node-and-edge feature processing
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when you need a PyTorch graph-transformer component and can provide graph features or configure the documented adjacency-matrix path.

Who it is for

  • Machine-learning developers building models over graph-structured data.
  • Researchers exploring graph-transformer components in protein-structure modeling pipelines.

Documented uses

  • Transform node and edge embeddings into updated graph representations.
  • Pass graph data represented by an adjacency matrix into a transformer model.
  • Use graph-transformer outputs as an input to downstream coordinate prediction or other modeling steps.
Before you choose

Requirements & limits

  • The model accepts node and edge tensors, or an adjacency matrix when configured with accept_adjacency_matrix=True.
  • The example exposes architecture choices including depth, edge dimension, feedforward layers, gated residuals and relative positional embeddings.
  • The repository identifies the project as MIT-licensed and provides a pip installation command.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Pass node and edge features through the graph transformer

Set up the documented model call with node features, edge features and a mask.

Before you start

  • Python environment with PyTorch
  • Installable package: graph-transformer-pytorch

Steps

  1. Install the package with the command below.

    Documented command
    pip install graph-transformer-pytorch
  2. Import torch and GraphTransformer from graph_transformer_pytorch.

  3. Create a GraphTransformer with node dimension, depth and edge dimension settings.

  4. Supply node and edge tensors with a mask, then receive updated node and edge representations.

Expected outcome

Updated node and edge representations; the documented example shows node output shaped for a later projection to 3D coordinates.

Guide limitations

  • The example does not include the coordinate-projection step.
  • The example dimensions and tensor shapes are illustrative code, not a compatibility guarantee.
Source-based practical guide

Configure the model to accept an adjacency matrix

Use the documented adjacency-matrix input path to obtain graph-transformer representations.

Before you start

  • Python environment with PyTorch
  • Installable package: graph-transformer-pytorch
  • Node features, an adjacency matrix and a mask

Steps

  1. Install the package with the command below.

    Documented command
    pip install graph-transformer-pytorch
  2. Create a GraphTransformer with accept_adjacency_matrix=True.

  3. Prepare node features, an adjacency matrix and a mask.

  4. Call the model with adj_mat and mask to obtain node and edge representations.

Expected outcome

The model returns node and edge representations from node features and adjacency-matrix input.

Guide limitations

  • The documented example does not explain how to construct an adjacency matrix from a particular dataset.
  • The example does not include a downstream prediction or coordinate-generation step.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
28 November 2026
Original website title
lucidrains/graph-transformer-pytorch · Official homepage title · retained in its source language