pelican.primitives.aggregate_1to2

pelican.primitives.aggregate_1to2(nodes, edge_index, batch, reduce='mean', **kwargs)[source]

Aggregate from nodes (rank 1) to edges (rank 2).

Parameters:
  • nodes (torch.Tensor) – Node-level features of shape (N, C).

  • edge_index (torch.Tensor) – Edge index tensor of shape (2, E).

  • batch (torch.Tensor) – Batch tensor of shape (N).

  • reduce (str, optional) – Reduction method to use (‘mean’, ‘sum’, ‘prod’, ‘amin’, ‘amax’), by default ‘mean’.

  • **kwargs

Returns:

ops – Aggregated features of shape (E, C, 5).

Return type:

torch.Tensor