<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/model-optimization/blob/v0.8.1/tensorflow_model_optimization/python/core/sparsity/keras/prunable_layer.py#L21-L39) |

Abstract Base Class for making your own keras layer prunable.

### Used in the notebooks

| Used in the guide |
|---|
| - [Pruning comprehensive guide](https://www.tensorflow.org/model_optimization/guide/pruning/comprehensive_guide) |

Custom keras layers which want to add pruning should implement this class.

## Methods

### `get_prunable_weights`

[View source](https://github.com/tensorflow/model-optimization/blob/v0.8.1/tensorflow_model_optimization/python/core/sparsity/keras/prunable_layer.py#L29-L39)

    @abc.abstractmethod
    get_prunable_weights()

Returns list of prunable weight tensors.

All the weight tensors which the layer wants to be pruned during
training must be returned by this method.

Returns: List of weight tensors/kernels in the keras layer which must be
pruned during training.