magnet.graph_utils.neighbours#

magnet.graph_utils.neighbours(graph: Data, node: int) Tensor#

Get the neighbours of a node.

Returns the indices of the neighbours of node in graph.

Parameters:
  • graph (Data) – Graph to be considered

  • node (int) – Node of which we want to get the neighbours.

Returns:

Tensor containing the indices of the neighbours.

Return type:

torch.Tensor