torch_geometric.nn.conv.CuGraphRGCNConv

class CuGraphRGCNConv(in_channels: int, out_channels: int, num_relations: int, num_bases: Optional[int] = None, aggr: str = 'mean', root_weight: bool = True, bias: bool = True)[source]

Bases: CuGraphModule

The relational graph convolutional operator from the “Modeling Relational Data with Graph Convolutional Networks” paper.

CuGraphRGCNConv is an optimized version of RGCNConv based on the cugraph-ops package that fuses message passing computation for accelerated execution and lower memory footprint.

forward(x: Tensor, edge_index: EdgeIndex, edge_type: Tensor, max_num_neighbors: Optional[int] = None) Tensor[source]

Runs the forward pass of the module.

Parameters:
  • x (torch.Tensor) – The node features.

  • edge_index (EdgeIndex) – The edge indices.

  • edge_type (torch.Tensor) – The edge type.

  • max_num_neighbors (int, optional) – The maximum number of neighbors of a target node. It is only effective when operating in a bipartite graph.. When not given, the value will be computed on-the-fly, leading to slightly worse performance. (default: None)

reset_parameters()[source]

Resets all learnable parameters of the module.