mlx_graphs.utils.transformations.get_src_dst_features

mlx_graphs.utils.transformations.get_src_dst_features#

mlx_graphs.utils.transformations.get_src_dst_features(edge_index: mlx.core.array, node_features: mlx.core.array | tuple[mlx.core.array, mlx.core.array]) tuple[mlx.core.array, mlx.core.array][source]#

Extracts source and destination node features based on the given edge indices.

Parameters:
  • edge_index (array) – a [2, num_edges] array representing the source and target nodes of each edge

  • node_features (Union[array, tuple[array, array]]) – The input array of node features.

Return type:

tuple[array, array]

Returns:

A tuple containing source and destination features.