class DirGNNConv(conv: MessagePassing, alpha: float = 0.5, root_weight: bool = True)[source]

Bases: Module

A generic wrapper for computing graph convolution on directed graphs as described in the “Edge Directionality Improves Learning on Heterophilic Graphs” paper. DirGNNConv will pass messages both from source nodes to target nodes and from target nodes to source nodes.

  • conv (MessagePassing) – The underlying MessagePassing layer to use.

  • alpha (float, optional) – The alpha coefficient used to weight the aggregations of in- and out-edges as part of a convex combination. (default: 0.5)

  • root_weight (bool, optional) – If set to True, the layer will add transformed root node features to the output. (default: True)

forward(x: Tensor, edge_index: Tensor) Tensor[source]

Resets all learnable parameters of the module.