code: def do_test(self, factory_string):
      ds = datasets.SyntheticDataset(32, 2000, 4000, 1000)
      k = 10
      index = faiss.index_factory(ds.d, factory_string)
      index.train(ds.get_train())
      index.add(ds.get_database())
      index.nprobe = 5
      Dref, Iref = index.search(ds.get_queries(), k)
      ngpu = faiss.get_num_gpus()
      res = [faiss.StandardGpuResources() for _ in range(ngpu)]
  
      def knn_function(
          xq, xb, k, metric=faiss.METRIC_L2, thread_id=None
      ):
          return faiss.knn_gpu(
              res[thread_id],
              xq,
              xb,
              k,
              metric=faiss.METRIC_L2,
              device=thread_id,
          )
  
      Dnew, Inew = big_batch_search.big_batch_search(
          index,
          ds.get_queries(),
          k,
          method="knn_function",
          knn=knn_function,
          threaded=8,
          computation_threads=ngpu,
      )
      self.assertLess((Inew != Iref).sum() / Iref.size, 1e-4)
      np.testing.assert_almost_equal(Dnew, Dref, decimal=4)
  
imports: import unittest
  import faiss
  import numpy
  from common_faiss_tests import get_dataset_2
  from faiss.contrib import datasets, evaluation, big_batch_search
  from faiss.contrib.exhaustive_search import knn_ground_truth, range_ground_truth, range_search_gpu, range_search_max_results, exponential_query_iterator
label_desc: Use image node_id 1 for calling the TestBigBatchSearchMultiGPU obj's underlying member method code with example usage: obj.do_test(factory_string) and returns: faiss