code: def __call__(self, x, nmb_clusters):
      device = x.device
      x = c_f.to_numpy(x).astype(np.float32)
      n_data, d = x.shape
      c_f.LOGGER.info(
          "running k-means clustering with k=%d" % nmb_clusters
      )
      c_f.LOGGER.info("embedding dimensionality is %d" % d)
  
      # faiss implementation of k-means
      kmeans = faiss.Kmeans(d, nmb_clusters, **self.kwargs)
      kmeans.train(x)
      _, idxs = kmeans.index.search(x, 1)
      return torch.tensor(
          [int(n[0]) for n in idxs], dtype=int, device=device
      )
  
imports: import numpy
  import torch
  from ..distances import BatchedDistance, CosineSimilarity
  from .None import common_functions
label_desc: Use image node_id 2 for calling the FaissKMeans obj's underlying member method code with example usage: obj.__call__(x, nmb_clusters) and returns: torch