class_docstr: How2 Video Retriver.
  Reference usage of FAISS:
  https://github.com/fairinternal/fairseq-py/blob/paraphrase_pretraining/fairseq/data/multilingual_faiss_dataset.py
class_docstr_tok: ["How2","Video","Retriver",".","Reference","usage","of","FAISS",":","https",":","\/\/github.com\/fairinternal\/fairseq-py\/blob\/paraphrase_pretraining\/fairseq\/data\/multilingual_faiss_dataset.py"]
code: def search(
      self,
      query_hidden_states,
      orig_dist,
  ):
      if len(self.videoid_to_vectoridx) != self.db.ntotal:
          raise ValueError(
              "cannot search: size mismatch in-between index and db",
              len(self.videoid_to_vectoridx),
              self.db.ntotal,
          )
  
      if self.vectoridx_to_videoid is None:
          self.vectoridx_to_videoid = {
              self.videoid_to_vectoridx[videoid]: videoid
              for videoid in self.videoid_to_vectoridx
          }
          assert len(self.vectoridx_to_videoid) == len(
              self.videoid_to_vectoridx
          )
  
      # MultilingualFaissDataset uses the following; not sure the purpose.
      # faiss.ParameterSpace().set_index_parameter(self.db, "nprobe", 10)
      queried_dist, index = self.db.search(query_hidden_states, 1)
      queried_dist, index = queried_dist[:, 0], index[:, 0]
  
      outputs = np.array(
          [
              self.vectoridx_to_videoid[_index]
              if _index != -1
              else (-1, -1, -1)
              for _index in index
          ],
          dtype=np.int32,
      )
      outputs[queried_dist <= orig_dist] = -1
      return outputs
  
imports: import os
  import numpy
  import pickle
  import time
  from collections import defaultdict
  from ..utils import get_local_rank, print_on_rank0
label_desc: Use image node_id 8 for calling the VectorRetriever obj's underlying member method code with example usage: obj.search(query_hidden_states, orig_dist) and returns: outputs