dgl.nn (PyTorch)¶
Conv Layers¶
CuGraph Conv Layers¶
An accelerated relational graph convolution layer from Modeling Relational Data with Graph Convolutional Networks that leverages the highlyoptimized aggregation primitives in cugraphops. 

Graph attention layer from Graph Attention Networks, with the sparse aggregation accelerated by cugraphops. 

An accelerated GraphSAGE layer from Inductive Representation Learning on Large Graphs that leverages the highlyoptimized aggregation primitives in cugraphops: 
Dense Conv Layers¶
Graph Convolutional layer from SemiSupervised Classification with Graph Convolutional Networks 

GraphSAGE layer from Inductive Representation Learning on Large Graphs 

Chebyshev Spectral Graph Convolution layer from Convolutional Neural Networks on Graphs with Fast Localized Spectral Filtering 
Global Pooling Layers¶
Apply sum pooling over the nodes in a graph. 

Apply average pooling over the nodes in a graph. 

Apply max pooling over the nodes in a graph. 

Sort Pooling from An EndtoEnd Deep Learning Architecture for Graph Classification 

Compute importance weights for atoms and perform a weighted sum. 

Global Attention Pooling from Gated Graph Sequence Neural Networks 

Set2Set operator from Order Matters: Sequence to sequence for sets 

The Encoder module from Set Transformer: A Framework for Attentionbased PermutationInvariant Neural Networks 

The Decoder module from Set Transformer: A Framework for Attentionbased PermutationInvariant Neural Networks 
Score Modules for Link Prediction and Knowledge Graph Completion¶
Predictor/score function for pairs of node representations 

Similarity measure from Translating Embeddings for Modeling Multirelational Data 

Similarity measure from Learning entity and relation embeddings for knowledge graph completion 
Heterogeneous Learning Modules¶
A generic module for computing convolution on heterogeneous graphs. 

Apply linear transformations on heterogeneous inputs. 

Create a heterogeneous embedding table. 

Linear transformation according to types. 
Utility Modules¶
A sequential container for stacking graph neural network modules 

Basis decomposition from Modeling Relational Data with Graph Convolutional Networks 

Layer that transforms one point set into a graph, or a batch of point sets with the same number of points into a batched union of those graphs. 

Layer that transforms one point set into a graph, or a batch of point sets with different number of points into a batched union of those graphs. 

Layer that transforms one point set into a bidirected graph with neighbors within given distance. 

The Jumping Knowledge aggregation module from Representation Learning on Graphs with Jumping Knowledge Networks 

Class for storing node embeddings. 

GNNExplainer model from GNNExplainer: Generating Explanations for Graph Neural Networks 

GNNExplainer model from GNNExplainer: Generating Explanations for Graph Neural Networks, adapted for heterogeneous graphs 

SubgraphX from On Explainability of Graph Neural Networks via Subgraph Explorations <https://arxiv.org/abs/2102.05152> 

SubgraphX from On Explainability of Graph Neural Networks via Subgraph Explorations, adapted for heterogeneous graphs 

Label Propagation from Learning from Labeled and Unlabeled Data with Label Propagation 
Network Embedding Modules¶
DeepWalk module from DeepWalk: Online Learning of Social Representations 

metapath2vec module from metapath2vec: Scalable Representation Learning for Heterogeneous Networks 
Utility Modules for Graph Transformer¶
Degree Encoder, as introduced in Do Transformers Really Perform Bad for Graph Representation? 

Laplacian Positional Encoder (LPE), as introduced in GraphGPS: General Powerful Scalable Graph Transformers 

Path Encoder, as introduced in Edge Encoding of Do Transformers Really Perform Bad for Graph Representation? 

Spatial Encoder, as introduced in Do Transformers Really Perform Bad for Graph Representation? 

3D Spatial Encoder, as introduced in One Transformer Can Understand Both 2D & 3D Molecular Data 

Dense MultiHead Attention Module with Graph Attention Bias. 

Graphormer Layer with Dense MultiHead Attention, as introduced in Do Transformers Really Perform Bad for Graph Representation? 