class_docstr: Wrapper object for a BlockData which similarity search via FAISS under the hood
class_docstr_tok: ["Wrapper","object","for","a","BlockData","which","similarity","search","via","FAISS","under","the","hood"]
docstr: Get the top-k blocks by the index distance metric.
  
  :param reconstruct: if True: return a [num_queries x k x embed_dim]
                          array of blocks
                      if False: return [num_queries x k] array of
                          distances, and another for indices
docstr_tok: ["Get","the","top-k","blocks","by","the","index","distance","metric",".",":","param","reconstruct",":","if","True",":","return","a","[","num_queries","x","k","x","embed_dim","]","array","of","blocks","if","False",":","return","[","num_queries","x","k","]","array","of","distances",",","and","another","for","indices"]
code: def search_mips_index(self, query_embeds, top_k, reconstruct=True):
      """
      Get the top-k blocks by the index distance metric.
  
      :param reconstruct: if True: return a [num_queries x k x embed_dim]
                              array of blocks
                          if False: return [num_queries x k] array of
                              distances, and another for indices
      """
      query_embeds = np.float32(detach(query_embeds))
  
      if reconstruct:
          # get the vectors themselves
          top_k_block_embeds = self.mips_index.search_and_reconstruct(
              query_embeds, top_k
          )
          return top_k_block_embeds
      else:
          # get distances and indices of closest vectors
          distances, block_indices = self.mips_index.search(
              query_embeds, top_k
          )
          return distances, block_indices
  
imports: import itertools
  import os
  import pickle
  import shutil
  import numpy
  import torch
  from megatron import get_args
  from megatron.core import mpu
label_desc: Use image node_id 6 for calling the FaissMIPSIndex obj's underlying member method code with example usage: obj.search_mips_index(query_embeds, top_k, reconstruct) and returns: top_k_block_embeds, distances,  block_indices