ML Community Day is November 9! Join us for updates from TensorFlow, JAX, and more Learn more

tfmot.sparsity.keras.PrunableLayer

Abstract Base Class for making your own keras layer prunable.

Used in the notebooks

Used in the guide

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

Methods

get_prunable_weights

View source

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.