MessagePassing

Shared message-passing utilities used by all graph convolution layers.

FunctionDescription
aggregate aggr msg targetIdx numNodes featuresScatter messages [E, F] to target nodes [N, F] using the given aggregation.
edgeSoftmax scores targetIdx numNodesEdge-wise softmax: softmax of scores grouped by target node index.
scores: [E] or [E, H], targetIdx: [E], numNodes: N.
Returns normalized attention coefficients with the same shape as scores.

aggregate

aggregate aggr msg targetIdx numNodes features

Scatter messages [E, F] to target nodes [N, F] using the given aggregation.

Parameters

  • aggr : Aggregation
  • msg : Tensor
  • targetIdx : Tensor
  • numNodes : int64
  • features : int64

Returns Tensor


edgeSoftmax

edgeSoftmax scores targetIdx numNodes

Edge-wise softmax: softmax of scores grouped by target node index. scores: [E] or [E, H], targetIdx: [E], numNodes: N. Returns normalized attention coefficients with the same shape as scores.

Parameters

  • scores : Tensor
  • targetIdx : Tensor
  • numNodes : int64

Returns Tensor