torch_geometric_signed_directed.utils.directed.features_in_out

Functions

directed_features_in_out(→ Tuple[torch.LongTensor, ...)

Computes directed in-degree and out-degree features.

Module Contents

directed_features_in_out(edge_index: torch.LongTensor, size: int, edge_weight: torch.FloatTensor | None = None, device: str = 'cpu') Tuple[torch.LongTensor, torch.LongTensor, torch.FloatTensor, torch.LongTensor, torch.FloatTensor]

Computes directed in-degree and out-degree features.

Arg types:
  • edge_index (PyTorch LongTensor) - The edge indices.

  • size (int or None) - The number of nodes, i.e. max_val + 1 of edge_index.

  • edge_weight (PyTorch Tensor, optional) - One-dimensional edge weights. (default: None)

  • device (str, optional) - The device to store the returned values. (default: :str:`cpu`)

Return types:
  • index_undirected (PyTorch LongTensor) - Undirected edge_index.

  • edge_in (PyTorch LongTensor) - Inwards edge indices.

  • in_weight (PyTorch Tensor) - Inwards edge weights.

  • edge_out (PyTorch LongTensor) - Outwards edge indices.

  • out_weight (PyTorch Tensor) - Outwards edge weights.