code: def testPCQATSelectiveClustering(self):
      # Baseline model training
      model = baseline_model()
  
      # Prune the model to have 50% sparsity
      pruned_model, pruned_stripped = _prune_model(model)
      sparsity_pruning = _check_sparsity_kernel(pruned_model)
  
      # Cluster the conv2d layers with 8 clusters
      preserve_sparsity = True
      (
          clustered_model,
          clustered_model_stripped,
      ) = selective_cluster_model(pruned_stripped, preserve_sparsity)
      _, (x_test, y_test) = _get_dataset()
      pc_result = clustered_model.evaluate(x_test, y_test)
      self.assertGreater(pc_result[1], 0.8)
  
      # Apply PCQAT on the pruned_clustered_model
      (
          pcqat_model,
          pcqat_model_stripped,
      ) = prune_cluster_preserve_quantize_model(
          clustered_model_stripped, True
      )
  
      # Evaluate the fp32 result of PCQAT
      pcqat_result = pcqat_model.evaluate(x_test, y_test)
      self.assertGreater(pcqat_result[1], 0.8)
  
      num_of_unique_weights_clst = _get_num_unique_weights_kernel(
          clustered_model_stripped
      )
      num_of_unique_weights_pcqat = _get_num_unique_weights_kernel(
          pcqat_model_stripped
      )
      # Selective clustering only applies to the conv2d layers,
      # here we only check the first layer's unique weights
      self.assertEqual(
          num_of_unique_weights_clst[0], num_of_unique_weights_pcqat[0]
      )
  
      # Check number of unique weights after clustering and pcqat should be
      # both less or equal to 8
      self.assertLessEqual(num_of_unique_weights_clst[0], 8)
  
      # Check sparsity for the selected layer for pruned_model and pcqat_model
      # to prove pcqat works on selective cases
      sparsity_pcqat = _check_sparsity_kernel(pcqat_model)
      self.assertGreaterEqual(sparsity_pcqat[0], sparsity_pruning[0])
  
      # Check the tflite conversion for pcqat
      pcqat_tflite_accuracy = _check_tflite_conversion(
          pcqat_model_stripped, False
      )
      self.assertGreater(pcqat_tflite_accuracy, 0.8)
  
      # Check the accuracy of PCQAT is not worse than the one of PC
      self.assertGreaterEqual(pcqat_result[1], pc_result[1])
  
imports: 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 cluster_utils
  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.sparsity.keras import prune
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_callbacks
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_schedule
label_desc: Use image node_id 2 for calling the FunctionalTest obj's underlying member method code with example usage: obj.testPCQATSelectiveClustering() without return types