code: def approx_knn_graph(
      x: Tensor,
      k: int,
      batch: Tensor = None,
      loop: bool = False,
      flow: str = "source_to_target",
  ) -> Tensor:  # pragma: no cover
      r"""Computes graph edges to the nearest approximated :obj:`k` points.
  
      .. note::
  
          Approximated :math:`k`-nearest neighbor search is performed via the
          `pynndescent <https://pynndescent.readthedocs.io/en/latest>`_ library.
  
      Args:
          x (torch.Tensor): Node feature matrix
              :math:`\mathbf{X} \in \mathbb{R}^{N \times F}`.
          k (int): The number of neighbors.
          batch (torch.Tensor, optional): Batch vector
              :math:`\mathbf{b} \in {\{ 0, \ldots, B-1\}}^N`, which assigns each
              node to a specific example. (default: :obj:`None`)
          loop (bool, optional): If :obj:`True`, the graph will contain
              self-loops. (default: :obj:`False`)
          flow (str, optional): The flow direction when using in combination with
              message passing (:obj:`"source_to_target"` or
              :obj:`"target_to_source"`). (default: :obj:`"source_to_target"`)
  
      :rtype: :class:`torch.Tensor`
      """
      assert flow in ["source_to_target", "target_to_source"]
      row, col = approx_knn(x, x, k if loop else k + 1, batch, batch)
      row, col = (
          (col, row) if flow == "source_to_target" else (row, col)
      )
      if not loop:
          mask = row != col
          row, col = row[mask], col[mask]
      return torch.stack([row, col], dim=0)
  
label_desc: Use image node_id 2 for calling a global function with example usage: approx_knn_graph(x, k, batch, loop, flow) and returns: torch