class_docstr: Unit tests for the ClusteringRegistry class.
class_docstr_tok: ["Unit","tests","for","the","ClusteringRegistry","class","."]
docstr: A built-in RNN layer with built-in RNN cells is clusterable.
docstr_tok: ["A","built-in","RNN","layer","with","built-in","RNN","cells","is","clusterable","."]
code: def testMakeClusterableWorksOnKerasRNNLayerWithRNNCellsParams(self):
      """A built-in RNN layer with built-in RNN cells is clusterable."""
      cell1 = layers.LSTMCell(10)
      cell2 = layers.GRUCell(5)
      cell_list = tf.keras.layers.StackedRNNCells([cell1, cell2])
  
      layer = layers.RNN(cell_list)
      with self.assertRaises(AttributeError):
          layer.get_clusterable_weights()
  
      ClusterRegistry.make_clusterable(layer)
      keras.Sequential([layer]).build(input_shape=(2, 3, 4))
  
      expected_weights = [
          ("kernel/0", layer.cell.cells[0].kernel),
          ("recurrent_kernel/0", layer.cell.cells[0].recurrent_kernel),
      ]
      self.assertEqual(
          expected_weights[0], layer.get_clusterable_weights()[0]
      )
  
      ClusterRegistry.make_clusterable(layer)
      keras.Sequential([layer]).build(input_shape=(2, 3, 4))
  
      expected_weights = [
          ("kernel/0", layer.cell.cells[0].kernel),
          ("recurrent_kernel/0", layer.cell.cells[0].recurrent_kernel),
      ]
      self.assertEqual(
          expected_weights[0], layer.get_clusterable_weights()[0]
      )
  
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 17 for calling the ClusterRegistryTest obj's underlying member method code with example usage: obj.testMakeClusterableWorksOnKerasRNNLayerWithRNNCellsParams() without return types