class_docstr: tests IP in addition to L2, non multiple of 8 dimensions
class_docstr_tok: ["tests","IP","in","addition","to","L2",",","non","multiple","of","8","dimensions"]
docstr: Test with 2 additional dimensions to take also the non-SIMD
  codepath. We don't retrain anything but add 2 dims to the
  queries, the centroids and the trained ScalarQuantizer.
code: def subtest_add2col(self, xb, xq, index, qname):
      """Test with 2 additional dimensions to take also the non-SIMD
      codepath. We don't retrain anything but add 2 dims to the
      queries, the centroids and the trained ScalarQuantizer.
      """
      nb, d = xb.shape
  
      d2 = d + 2
      xb2 = self.add2columns(xb)
      xq2 = self.add2columns(xq)
  
      nlist = index.nlist
      quantizer = faiss.downcast_index(index.quantizer)
      quantizer2 = faiss.IndexFlat(d2, index.metric_type)
      centroids = faiss.vector_to_array(quantizer.codes)
      centroids = centroids.view("float32").reshape(nlist, d)
      centroids2 = self.add2columns(centroids)
      quantizer2.add(centroids2)
      index2 = faiss.IndexIVFScalarQuantizer(
          quantizer2, d2, index.nlist, index.sq.qtype, index.metric_type
      )
      index2.nprobe = 4
      if qname in ("8bit", "4bit"):
          trained = faiss.vector_to_array(index.sq.trained).reshape(
              2, -1
          )
          nt = trained.shape[1]
          # 2 lines: vmins and vdiffs
          new_nt = int(nt * d2 / d)
          trained2 = np.hstack(
              (trained, np.zeros((2, new_nt - nt), dtype="float32"))
          )
          trained2[1, nt:] = 1.0  # set vdiff to 1 to avoid div by 0
          faiss.copy_array_to_vector(
              trained2.ravel(), index2.sq.trained
          )
      else:
          index2.sq.trained = index.sq.trained
  
      index2.is_trained = True
      index2.add(xb2)
      return index2.search(xq2, 10)
  
imports: from __future__ import absolute_import, division, print_function
  import unittest
  import faiss
  import numpy
  from common_faiss_tests import Randu10k, get_dataset_2, Randu10kUnbalanced
label_desc: Use image node_id 2 for calling the TestSQFlavors obj's underlying member method code with example usage: obj.subtest_add2col(xb, xq, index, qname) and returns: index2