pylibcugraphops.pytorch.operators.update_efeat_e2e#

pylibcugraphops.pytorch.operators.update_efeat_e2e(edge_feat: Optional[Tensor], node_feat: Union[Tensor, Tuple[Optional[Tensor]]], graph: CSC, use_source_emb: bool, use_target_emb: bool, mode: str = 'concat') Tensor#

PyTorch autograd function for creating new edge features (update_efeat) based on either concatenating or summing edge features and the features of the corresponding source and destination node of each edge in an edge-to-edge fashion (e2e).

Parameters:
edge_feattorch.Tensor | None

The input edge features - ignored if passed as None. Shape: (num_indices, dim_edge).

node_feattorch.Tensor | Tuple[torch.Tensor] | None

The input source features. For bipartite graphs, a tuple of source and destionations node features with shapes (num_src_nodes, dim_src) and (num_dst_nodes, dim_dst) respectively is expected. For non-bipartite graph, a single tensor of node features of shape (num_dst_nodes, dim_node) is expected with dim_src = dim_dst = dim_node.

use_source_embbool

whether to use node embeddings indexed by indices of source nodes

use_target_embbool

whether to use node embeddings indexed by indices of source nodes

graphCSC

The graph used for the operation.

modestr, default=”concat”

Mode of update, either "concat" or "sum".

Returns:
outputtorch.Tensor

The output after either concatenation or summation. Shape for mode=concat: (num_indices, dim_edge + dim_src + dim_dst). Shape for mode=sum: (num_indices, dim_edge).