code: def do_test(self, d, dsub):
      M = d // dsub
      pq = faiss.ProductQuantizer(d, M, 8)
      xt = faiss.randn((max(1000, pq.ksub * 50), d), 123)
      pq.cp.niter = 4  # to avoid timeouts in tests
      pq.train(xt)
  
      codes = pq.compute_codes(xt)
  
      # enable transposed centroids table to speedup compute_codes()
      pq.sync_transposed_centroids()
      codes_transposed = pq.compute_codes(xt)
  
      # disable transposed centroids table
      pq.clear_transposed_centroids()
      codes_cleared = pq.compute_codes(xt)
  
      assert np.all(codes == codes_transposed)
      assert np.all(codes == codes_cleared)
  
imports: from __future__ import absolute_import, division, print_function
  import numpy
  import faiss
  import unittest
label_desc: Use image node_id 1 for calling the TestPQTransposedCentroids obj's underlying member method code with example usage: obj.do_test(d, dsub) without return types