class_docstr: Unit tests for the ClusteringRegistry class.
class_docstr_tok: ["Unit","tests","for","the","ClusteringRegistry","class","."]
docstr: Test bidirectional wrapper with LSTM layer.
  
  Verifies that make_clusterable() works as expected on a Bidirectional
  wrapper with a LSTM layer
docstr_tok: ["Test","bidirectional","wrapper","with","LSTM","layer",".","Verifies","that","make_clusterable","(",")","works","as","expected","on","a","Bidirectional","wrapper","with","a","LSTM","layer"]
code: def testMakeClusterableWorksOnKerasBidirectionalLayerWithLSTM(self):
      """Test bidirectional wrapper with LSTM layer.
  
      Verifies that make_clusterable() works as expected on a Bidirectional
      wrapper with a LSTM layer
      """
      layer = tf.keras.layers.Bidirectional(layers.LSTM(10))
      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.forward_layer.cell.kernel),
          (
              "recurrent_kernel/0",
              layer.forward_layer.cell.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 18 for calling the ClusterRegistryTest obj's underlying member method code with example usage: obj.testMakeClusterableWorksOnKerasBidirectionalLayerWithLSTM() without return types