class_docstr: Unit tests for clustering lookup algorithms.
class_docstr_tok: ["Unit","tests","for","clustering","lookup","algorithms","."]
docstr: Verifies that get_clustered_weight function works as expected.
docstr_tok: ["Verifies","that","get_clustered_weight","function","works","as","expected","."]
code: def testConvolutionalWeightsPerChannelCA(
      self,
      data_format,
      clustering_centroids,
      pulling_indices,
      expected_output,
  ):
      """Verifies that get_clustered_weight function works as expected."""
      clustering_centroids = tf.Variable(
          clustering_centroids, dtype=tf.float32
      )
      clustering_algo = (
          clustering_registry.ClusteringAlgorithmPerChannel(
              clustering_centroids, GradientAggregation.SUM, data_format
          )
      )
      # Note that clustered_weights has the same shape as pulling_indices,
      # because they are defined inside of the check function.
      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 7 for calling the ClusteringAlgorithmTest obj's underlying member method code with example usage: obj.testConvolutionalWeightsPerChannelCA(data_format, clustering_centroids, pulling_indices, expected_output) without return types