docstr: Test keras custom layer.
  
  We test the keras custom layer with the provided clustering algorithm
  (see MyClusterableLayer above). We cluster only 'w' weights and the class
  ClusterableWeightsCA provides the function get_pulling_indices for the
  layer-out of 'w' weights.
  
  We skip evaluation in this test as it takes some time.
docstr_tok: ["Test","keras","custom","layer",".","We","test","the","keras","custom","layer","with","the","provided","clustering","algorithm","(","see","MyClusterableLayer","above",")",".","We","cluster","only","'","w","'","weights","and","the","class","ClusterableWeightsCA","provides","the","function","get_pulling_indices","for","the","layer-out","of","'","w","'","weights",".","We","skip","evaluation","in","this","test","as","it","takes","some","time","."]
code: def testMnistClusterableLayer(self):
      """Test keras custom layer.
  
      We test the keras custom layer with the provided clustering algorithm
      (see MyClusterableLayer above). We cluster only 'w' weights and the class
      ClusterableWeightsCA provides the function get_pulling_indices for the
      layer-out of 'w' weights.
  
      We skip evaluation in this test as it takes some time.
      """
      model = _build_model_2()
      _train_model(model)
  
      # Checks that number of original weights 'w' is greater than
      # the number of clusters.
      nr_of_unique_weights = _get_number_of_unique_weights(
          model, -1, "w"
      )
      self.assertGreater(nr_of_unique_weights, NUMBER_OF_CLUSTERS)
  
      clustered_model = _cluster_model(model, NUMBER_OF_CLUSTERS)
  
      # Checks clustered weights 'w'.
      nr_of_unique_weights = _get_number_of_unique_weights(
          clustered_model, -1, "w"
      )
      self.assertLessEqual(nr_of_unique_weights, NUMBER_OF_CLUSTERS)
  
      # Train again normally for sanity check
      _train_model(clustered_model)
  
imports: 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 import clusterable_layer
  from tensorflow_model_optimization.python.core.clustering.keras import clustering_algorithm
label_desc: Use image node_id 2 for calling the FunctionalTest obj's underlying member method code with example usage: obj.testMnistClusterableLayer() without return types