pylibcugraphops.pytorch.operators.agg_concat_n2n#

pylibcugraphops.pytorch.operators.agg_concat_n2n(feat: Union[Tensor, Tuple[Tensor]], graph: CSC, aggr: str = 'sum', edge_weight: Optional[Tensor] = None) Tensor#

PyTorch autograd function for simple aggregation using node features in an node-to-node reduction (n2n) while concatenating the original features of output at the end (agg_concat).

Parameters:
feattorch.Tensor | Tuple[torch.Tensor]

The input node features. Shape: (n_src_nodes, dim_in) if graph is non-bipartite. Shape: (n_src_nodes, dim_in) and (n_dst_nodes, dim_concat) if graph is bipartite.

graphCSC

The graph used for the operation.

aggrstr, default=”sum”

Aggregation operation. Choose from "max", "mean", "min", "sum".

edge_weightOptional[torch.Tensor], default=None

When passing additional edge weights, the aggregation is done in a weighted fashion. Note that for min/max the result after weighting features with those edge weights is returned. Edge weights are indexed in the same fashion as the indices in graph. Shape: (n_edges, ).

Returns:
outputtorch.Tensor

The aggregation output. Shape: (n_dst_nodes, 2 * dim_in).