docstr: If pruned_clustered_model has uniform weights, it won't break PCQAT.
docstr_tok: ["If","pruned_clustered_model","has","uniform","weights",",","it","wo","n't","break","PCQAT","."]
code: def testPassingModelWithUniformWeightsToPCQAT(self, uniform_weights):
      """If pruned_clustered_model has uniform weights, it won't break PCQAT."""
      preserve_sparsity = True
      original_model = tf.keras.Sequential(
          [
              layers.Dense(5, activation="softmax", input_shape=(10,)),
              layers.Flatten(),
          ]
      )
  
      # Manually set all weights to the same value in the Dense layer
      first_layer_weights = original_model.layers[0].get_weights()
      first_layer_weights[0][:] = uniform_weights
      original_model.layers[0].set_weights(first_layer_weights)
  
      # Start the sparsity-aware clustering
      clustering_params = {
          "number_of_clusters": 4,
          "cluster_centroids_init": cluster_config.CentroidInitialization.LINEAR,
          "preserve_sparsity": True,
      }
  
      clustered_model = experimental_cluster.cluster_weights(
          original_model, **clustering_params
      )
      clustered_model = cluster.strip_clustering(clustered_model)
  
      nr_of_unique_weights_after = self._get_number_of_unique_weights(
          clustered_model, 0, "kernel"
      )
      sparsity_pruning = self._get_sparsity(clustered_model)
  
      quant_aware_annotate_model = quantize.quantize_annotate_model(
          clustered_model
      )
  
      sparsity_pcqat, unique_weights_pcqat = self._pcqat_training(
          preserve_sparsity, quant_aware_annotate_model
      )
      self.assertAllGreaterEqual(
          np.array(sparsity_pcqat), sparsity_pruning[0]
      )
      self.assertAllEqual(
          nr_of_unique_weights_after, unique_weights_pcqat
      )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_model_optimization.python.core.clustering.keras import cluster
  from tensorflow_model_optimization.python.core.clustering.keras import cluster_config
  from tensorflow_model_optimization.python.core.clustering.keras.experimental import cluster
  from tensorflow_model_optimization.python.core.quantization.keras import quantize
  from tensorflow_model_optimization.python.core.quantization.keras.collab_opts.cluster_preserve import default_8bit_cluster_preserve_quantize_scheme
  from tensorflow_model_optimization.python.core.quantization.keras.collab_opts.cluster_preserve.cluster_utils import strip_clustering_cqat
label_desc: Use image node_id 18 for calling the ClusterPreserveIntegrationTest obj's underlying member method code with example usage: obj.testPassingModelWithUniformWeightsToPCQAT(uniform_weights) without return types