class_docstr: Registry responsible for built-in keras layers.
docstr: Modifies a built-in layer object to support pruning.
  
  Args:
    layer: layer to modify for support.
  
  Returns:
    The modified layer object.
docstr_tok: ["Modifies","a","built-in","layer","object","to","support","pruning",".","Args",":","layer",":","layer","to","modify","for","support",".","Returns",":","The","modified","layer","object","."]
code: def make_prunable(cls, layer):
      """Modifies a built-in layer object to support pruning.
  
      Args:
        layer: layer to modify for support.
  
      Returns:
        The modified layer object.
  
      """
  
      if not cls.supports(layer):
          raise ValueError(
              "Layer " + str(layer.__class__) + " is not supported."
          )
  
      def get_prunable_weights():
          return [
              getattr(layer, weight)
              for weight in cls._weight_names(layer)
          ]
  
      def get_prunable_weights_rnn():  # pylint: disable=missing-docstring
          def get_prunable_weights_rnn_cell(cell):
              if cell.__class__ in cls._RNN_CELLS_WEIGHTS_MAP:
                  return [
                      getattr(cell, weight)
                      for weight in cls._RNN_CELLS_WEIGHTS_MAP[
                          cell.__class__
                      ]
                  ]
  
              if isinstance(cell, prunable_layer.PrunableLayer):
                  return cell.get_prunable_weights()
  
              raise ValueError(
                  cls._RNN_CELL_ERROR_MSG.format(
                      layer.__class__,
                      cell.__class__,
                      cls._RNN_CELLS_WEIGHTS_MAP.keys(),
                  )
              )
  
          prunable_weights = []
          for rnn_cell in cls._get_rnn_cells(layer):
              prunable_weights.extend(
                  get_prunable_weights_rnn_cell(rnn_cell)
              )
          return prunable_weights
  
      def get_prunable_weights_mha():  # pylint: disable=missing-docstring
          def get_prunable_weights_mha_weight(weight_name):
              pre, _, post = weight_name.rpartition(".")
              return getattr(getattr(layer, pre), post)
  
          prunable_weights = []
          for weight_name in cls._weight_names(layer):
              prunable_weights.append(
                  get_prunable_weights_mha_weight(weight_name)
              )
          return prunable_weights
  
      if cls._is_rnn_layer(layer):
          layer.get_prunable_weights = get_prunable_weights_rnn
      elif cls._is_mha_layer(layer):
          layer.get_prunable_weights = get_prunable_weights_mha
      else:
          layer.get_prunable_weights = get_prunable_weights
  
      return layer
  
file_path: model-optimization/tensorflow_model_optimization/python/core/sparsity/keras/prune_registry.py
imports: import tensorflow
  from tensorflow_model_optimization.python.core.sparsity.keras import prunable_layer
label_desc: Use image node_id 6 for calling the PruneRegistry obj's underlying member method code with example usage: obj.make_prunable(cls, layer) and returns: layer, unknown, prunable_weights, prunable_weights, getattr, unknown, cell