class_docstr: Unit tests for clustering lookup algorithms.
class_docstr_tok: ["Unit","tests","for","clustering","lookup","algorithms","."]
docstr: Verifies that ClusteringAlgorithm works as expected.
docstr_tok: ["Verifies","that","ClusteringAlgorithm","works","as","expected","."]
code: def testConvolutionalWeightsCA(
      self, clustering_centroids, pulling_indices, expected_output
  ):
      """Verifies that ClusteringAlgorithm works as expected."""
      clustering_centroids = tf.Variable(
          clustering_centroids, dtype=tf.float32
      )
      clustering_algo = clustering_registry.ClusteringAlgorithm(
          clustering_centroids, GradientAggregation.SUM
      )
      self._check_pull_values(
          clustering_algo, pulling_indices, expected_output
      )
  
imports: from absl.testing import parameterized
  import tensorflow
  from tensorflow_model_optimization.python.core.clustering.keras import clusterable_layer
  from tensorflow_model_optimization.python.core.clustering.keras import clustering_registry
  from tensorflow_model_optimization.python.core.clustering.keras.cluster_config import GradientAggregation
label_desc: Use image node_id 6 for calling the ClusteringAlgorithmTest obj's underlying member method code with example usage: obj.testConvolutionalWeightsCA(clustering_centroids, pulling_indices, expected_output) without return types