class_docstr: Creates a k-NN graph based on node positions :obj:`data.pos`
  (functional name: :obj:`knn_graph`).
  
  Args:
      k (int, optional): The number of neighbors. (default: :obj:`6`)
      loop (bool, optional): If :obj:`True`, the graph will contain
          self-loops. (default: :obj:`False`)
      force_undirected (bool, optional): If set to :obj:`True`, new edges
          will be undirected. (default: :obj:`False`)
      flow (str, optional): The flow direction when used in combination with
          message passing (:obj:`"source_to_target"` or
          :obj:`"target_to_source"`).
          If set to :obj:`"source_to_target"`, every target node will have
          exactly :math:`k` source nodes pointing to it.
          (default: :obj:`"source_to_target"`)
      cosine (bool, optional): If :obj:`True`, will use the cosine
          distance instead of euclidean distance to find nearest neighbors.
          (default: :obj:`False`)
      num_workers (int): Number of workers to use for computation. Has no
          effect in case :obj:`batch` is not :obj:`None`, or the input lies
          on the GPU. (default: :obj:`1`)
code: def __repr__(self) -> str:
      return f"{self.__class__.__name__}(k={self.k})"
  
file_path: pytorch_geometric/torch_geometric/transforms/knn_graph.py
imports: import torch_geometric
  from torch_geometric.data import Data
  from torch_geometric.data.datapipes import functional_transform
  from torch_geometric.transforms import BaseTransform
  from torch_geometric.utils import to_undirected
label_desc: Use image node_id 3 for calling the KNNGraph obj's underlying member method code with example usage: obj.__repr__() and returns: self, str, self, str