class_docstr: Internal class to create the op to initialize the clusters.
  
  The op performs this algorithm (see constructor args):
  
  num_remaining = num_clusters - length(cluster_centers)
  if num_remaining == 0:
    assert that cluster_centers_initialized is true
  else:
    assert that num_remaining > 0
    new_centers = choose up to num_remaining initial centers
    l2-normalize new_centers if using cosine distance
    all_centers = concat(cluster_centers, new_centers)
    cluster_centers := all_centers
    if there is a cluster_centers_updated variable:
      cluster_centers_updated := cluster_centers
    num_now_remaining = num_clusters - length(cluster_centers)
    if num_now_remaining == 0:
      cluster_centers_initialized := true
docstr: Creates an op factory.
  
  Args:
    inputs: See KMeans constructor.
    num_clusters: An integer Tensor providing the number of clusters.
    initial_clusters: See KMeans constructor.
    distance_metric: See KMeans constructor.
    random_seed: See KMeans constructor.
    kmeans_plus_plus_num_retries: See KMeans constructor.
    kmc2_chain_length: See KMeans constructor.
    cluster_centers: The TF variable holding the initial centers. It may
      already contain some centers when the op is executed.
    cluster_centers_updated: A second TF variable to hold a copy of the
      initial centers, used for full-batch mode. In mini-batch mode,
      cluster_centers_updated is the same variable as cluster_centers.
    cluster_centers_initialized: A boolean TF variable that will be set to
      true when all the initial centers have been chosen.
docstr_tok: ["Creates","an","op","factory",".","Args",":","inputs",":","See","KMeans","constructor",".","num_clusters",":","An","integer","Tensor","providing","the","number","of","clusters",".","initial_clusters",":","See","KMeans","constructor",".","distance_metric",":","See","KMeans","constructor",".","random_seed",":","See","KMeans","constructor",".","kmeans_plus_plus_num_retries",":","See","KMeans","constructor",".","kmc2_chain_length",":","See","KMeans","constructor",".","cluster_centers",":","The","TF","variable","holding","the","initial","centers",".","It","may","already","contain","some","centers","when","the","op","is","executed",".","cluster_centers_updated",":","A","second","TF","variable","to","hold","a","copy","of","the","initial","centers",",","used","for","full-batch","mode",".","In","mini-batch","mode",",","cluster_centers_updated","is","the","same","variable","as","cluster_centers",".","cluster_centers_initialized",":","A","boolean","TF","variable","that","will","be","set","to","true","when","all","the","initial","centers","have","been","chosen","."]
code: def __init__(
      self,
      inputs,
      num_clusters,
      initial_clusters,
      distance_metric,
      random_seed,
      kmeans_plus_plus_num_retries,
      kmc2_chain_length,
      cluster_centers,
      cluster_centers_updated,
      cluster_centers_initialized,
  ):
      """Creates an op factory.
  
      Args:
        inputs: See KMeans constructor.
        num_clusters: An integer Tensor providing the number of clusters.
        initial_clusters: See KMeans constructor.
        distance_metric: See KMeans constructor.
        random_seed: See KMeans constructor.
        kmeans_plus_plus_num_retries: See KMeans constructor.
        kmc2_chain_length: See KMeans constructor.
        cluster_centers: The TF variable holding the initial centers. It may
          already contain some centers when the op is executed.
        cluster_centers_updated: A second TF variable to hold a copy of the
          initial centers, used for full-batch mode. In mini-batch mode,
          cluster_centers_updated is the same variable as cluster_centers.
        cluster_centers_initialized: A boolean TF variable that will be set to
          true when all the initial centers have been chosen.
      """
      # All of these instance variables are constants.
      self._inputs = inputs
      self._num_clusters = num_clusters
      self._initial_clusters = initial_clusters
      self._distance_metric = distance_metric
      self._seed = random_seed
      self._kmeans_plus_plus_num_retries = kmeans_plus_plus_num_retries
      self._kmc2_chain_length = kmc2_chain_length
      self._cluster_centers = cluster_centers
      self._cluster_centers_updated = cluster_centers_updated
      self._cluster_centers_initialized = cluster_centers_initialized
  
      self._num_selected = array_ops.shape(self._cluster_centers)[0]
      self._num_remaining = self._num_clusters - self._num_selected
      self._num_data = math_ops.add_n(
          [array_ops.shape(i)[0] for i in self._inputs]
      )
  
imports: from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import random_seed
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import check_ops
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import gen_clustering_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_impl
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import state_ops
  from tensorflow.python.ops import variable_v1
  from tensorflow.python.ops import while_loop
  from tensorflow.python.ops.embedding_ops import embedding_lookup
  from tensorflow.python.ops.gen_clustering_ops import *
label_desc: Use image node_id 1 to create a new _InitializeClustersOpFactory object  with example: obj = _InitializeClustersOpFactory(inputs, num_clusters, initial_clusters, distance_metric, random_seed, kmeans_plus_plus_num_retries, kmc2_chain_length, cluster_centers, cluster_centers_updated, cluster_centers_initialized)