docstr: test compute_LUT function
docstr_tok: ["test","compute_LUT","function"]
code: def test_lut(self):
      """test compute_LUT function"""
      ds = datasets.SyntheticDataset(16, 1000, 0, 100)
  
      xt = ds.get_train()
      xq = ds.get_queries()
  
      nsplits = 2
      Msub = 2
      nbits = 4
      nq, d = xq.shape
      dsub = d // nsplits
  
      plsq = faiss.ProductLocalSearchQuantizer(
          ds.d, nsplits, Msub, nbits
      )
      plsq.train(xt)
  
      subcodebook_size = Msub * (1 << nbits)
      codebook_size = nsplits * subcodebook_size
      lut = np.zeros((nq, codebook_size), dtype=np.float32)
      plsq.compute_LUT(nq, sp(xq), sp(lut))
  
      codebooks = faiss.vector_to_array(plsq.codebooks)
      codebooks = codebooks.reshape(nsplits, subcodebook_size, dsub)
      xq = xq.reshape(nq, nsplits, dsub)
      lut_ref = np.zeros(
          (nq, nsplits, subcodebook_size), dtype=np.float32
      )
      for i in range(nsplits):
          lut_ref[:, i] = xq[:, i] @ codebooks[i].T
      lut_ref = lut_ref.reshape(nq, codebook_size)
  
      np.testing.assert_allclose(lut, lut_ref, rtol=5e-04)
  
imports: import numpy
  import faiss
  import unittest
  from faiss.contrib import datasets
label_desc: Use image node_id 3 for calling the TestProductLocalSearchQuantizer obj's underlying member method code with example usage: obj.test_lut() without return types