# tf.contrib.model_pruning.Pruning

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/model_pruning/python/pruning.py#L232-L622) |

    tf.contrib.model_pruning.Pruning(
        spec=None, global_step=None, sparsity=None
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `spec` | Pruning spec as defined in pruning.proto |
| `global_step` | A tensorflow variable that is used while setting up the sparsity function |
| `sparsity` | A tensorflow scalar variable storing the sparsity |

<br />

## Methods

### `add_pruning_summaries`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/model_pruning/python/pruning.py#L610-L619)

    add_pruning_summaries()

Adds summaries of weight sparsities and thresholds.

### `conditional_mask_update_op`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/model_pruning/python/pruning.py#L583-L608)

    conditional_mask_update_op()

### `mask_update_op`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/model_pruning/python/pruning.py#L569-L581)

    mask_update_op()

### `print_hparams`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/model_pruning/python/pruning.py#L621-L622)

    print_hparams()