class_docstr: A base class to perform fast :math:`k`-nearest neighbor search
  (:math:`k`-NN) via the :obj:`faiss` library.
  
  Please ensure that :obj:`faiss` is installed by running
  
  .. code-block:: bash
  
      pip install faiss-cpu
      # or
      pip install faiss-gpu
  
  depending on whether to plan to use GPU-processing for :math:`k`-NN search.
  
  Args:
      index_factory (str): The name of the index factory to use, *e.g.*,
          :obj:`"IndexFlatL2"` or :obj:`"IndexFlatIP"`. See `here
          <https://github.com/facebookresearch/faiss/wiki/
          The-index-factory>`_ for more information.
      emb (torch.Tensor, optional): The data points to add.
          (default: :obj:`None`)
class_docstr_tok: ["A","base","class","to","perform","fast",":","math",":","`","k","`","-nearest","neighbor","search","(",":","math",":","`","k","`","-NN",")","via","the",":","obj",":","`","faiss","`","library",".","Please","ensure","that",":","obj",":","`","faiss","`","is","installed","by","running","..","code-block",":",":","bash","pip","install","faiss-cpu","#","or","pip","install","faiss-gpu","depending","on","whether","to","plan","to","use","GPU-processing","for",":","math",":","`","k","`","-NN","search",".","Args",":","index_factory","(","str",")",":","The","name","of","the","index","factory","to","use",",","*","e.g",".","*",",",":","obj",":","`","``","IndexFlatL2","''","`","or",":","obj",":","`","``","IndexFlatIP","''","`",".","See","`","here","<","https",":","\/\/github.com\/facebookresearch\/faiss\/wiki\/","The-index-factory",">","`","_","for","more","information",".","emb","(","torch.Tensor",",","optional",")",":","The","data","points","to","add",".","(","default",":",":","obj",":","`","None","`",")"]
docstr: Returns the data points stored in the :class:`KNNIndex`.
docstr_tok: ["Returns","the","data","points","stored","in","the",":","class",":","`","KNNIndex","`","."]
code: def get_emb(self) -> Tensor:
      r"""Returns the data points stored in the :class:`KNNIndex`."""
      if self.index is None:
          raise RuntimeError(
              f"'{self.__class__.__name__}' is not yet "
              "initialized. Please call `add(...)` first."
          )
  
      return self.index.reconstruct_n(0, self.numel)
  
imports: import warnings
  from typing import NamedTuple, Optional
  import torch
  from torch import Tensor
  from torch_geometric.utils import cumsum, degree, to_dense_batch
label_desc: Use image node_id 5 for calling the KNNIndex obj's underlying member method code with example usage: obj.get_emb() and returns: self