class_docstr: _EfficientKMeans is primarily used by palettization to perform a k-means operation. This class also has an in-house
  implementation of k-means, called ``kmeans_pp`` which runs entirely on GPU and is ~10x faster than sklearn's API.
code: def get_best_rank(self, metric, func=_torch.argmin):
      if _dist.is_available() and _dist.is_initialized():
          world_size = _dist.get_world_size()
          if world_size > 1:
              tensor_list = [
                  _torch.zeros_like(metric) for _ in range(world_size)
              ]
              _dist.all_gather(tensor_list, metric)
              bcast_rank = func(_torch.Tensor(tensor_list))
  
              return bcast_rank
  
      return None
  
file_path: coremltools/coremltools/optimize/torch/palettization/_efficient_kmeans.py
imports: import numpy
  import torch
  import torch.distributed
label_desc: Use image node_id 8 for calling the _EfficientKMeans obj's underlying member method code with example usage: obj.get_best_rank(metric, func) and returns: None, bcast_rank