code: def test_update_vectors(self):
      d = 32
      quantizer_np = faiss.IndexFlatL2(d)
      index_np = faiss.IndexIVFFlat(quantizer_np, d, 5)
      index_np.make_direct_map()
      index_np.set_direct_map_type(faiss.DirectMap.Hashtable)
  
      quantizer_torch = faiss.IndexFlatL2(d)
      index_torch = faiss.IndexIVFFlat(quantizer_torch, d, 5)
      index_torch.make_direct_map()
      index_torch.set_direct_map_type(faiss.DirectMap.Hashtable)
  
      xb = torch.rand(1000, d, dtype=torch.float32)
      ids = torch.arange(1000, 1000 + xb.shape[0], dtype=torch.int64)
  
      index_np.train(xb.numpy())
      index_np.add_with_ids(xb.numpy(), ids.numpy())
  
      index_torch.train(xb)
      index_torch.add_with_ids(xb, ids)
  
      xb_up = torch.rand(10, d, dtype=torch.float32)
      ids_up = ids[0:10]
  
      index_np.update_vectors(ids_up.numpy(), xb_up.numpy())
      index_torch.update_vectors(ids_up, xb_up)
  
      xq = torch.rand(10, d, dtype=torch.float32)
  
      D_np, I_np = index_np.search(xq.numpy(), 5)
      D_torch, I_torch = index_torch.search(xq, 5)
  
      self.assertTrue(np.array_equal(D_np, D_torch.numpy()))
      self.assertTrue(np.array_equal(I_np, I_torch.numpy()))
  
file_path: faiss/tests/torch_test_contrib.py
imports: import faiss
  import torch
  import unittest
  import numpy
  import faiss.contrib.torch_utils
label_desc: Use image node_id 6 for calling the TestTorchUtilsCPU obj's underlying member method code with example usage: obj.test_update_vectors() without return types