class_docstr: Cluster centroids based on kmeans++ algorithm.
class_docstr_tok: ["Cluster","centroids","based","on","kmeans++","algorithm","."]
code: def _calculate_centroids_for_interval(
      self, weight_interval, number_of_clusters_for_interval
  ):
      if tf.math.less_equal(number_of_clusters_for_interval, 0):
          # Return an empty array of centroids
          return tf.constant([])
  
      weights = tf.reshape(weight_interval, [-1, 1])
      cluster_centroids = (
          clustering_ops.kmeans_plus_plus_initialization(
              weights,
              number_of_clusters_for_interval,
              seed=9,
              num_retries_per_sample=-1,
          )
      )
  
      return tf.reshape(
          cluster_centroids, [number_of_clusters_for_interval]
      )
  
imports: import abc
  import six
  import tensorflow
  from tensorflow.python.ops import clustering_ops
  from tensorflow_model_optimization.python.core.clustering.keras import cluster_config
label_desc: Use image node_id 1 for calling the KmeansPlusPlusCentroidsInitialisation obj's underlying member method code with example usage: obj._calculate_centroids_for_interval(weight_interval, number_of_clusters_for_interval) and returns: tf, tf