parameters: (index_ivf, x, a, ids=None)
docstring: Add elements to an IVF index, where the assignment is already computed
docstring_summary: Add elements to an IVF index, where the assignment is already computed
docstring_tokens: Add elements to an IVF index where the assignment is already computed
function: def add_preassigned(index_ivf, x, a, ids=None):
      """
      Add elements to an IVF index, where the assignment is already computed
      """
      n, d = x.shape
      assert a.shape == (n, )
      if isinstance(index_ivf, faiss.IndexBinaryIVF):
          d *= 8
      assert d == index_ivf.d
      if ids is not None:
          assert ids.shape == (n, )
          ids = faiss.swig_ptr(ids)
      index_ivf.add_core(
          n, faiss.swig_ptr(x), ids, faiss.swig_ptr(a)
      )
function_tokens: def add_preassigned ( index_ivf , x , a , ids = None ) : n , d = x . shape assert a . shape == ( n , ) if isinstance ( index_ivf , faiss . IndexBinaryIVF ) : d *= 8 assert d == index_ivf . d if ids is not None : assert ids . shape == ( n , ) ids = faiss . swig_ptr ( ids ) index_ivf . add_core ( n , faiss . swig_ptr ( x ) , ids , faiss . swig_ptr ( a ) )