<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/models/blob/v2.20.0/official/core/actions.py#L30-L73) |

Train action to updates pruning related information.

    tfm.core.actions.PruningAction(
        export_dir: str,
        model: tf_keras.Model,
        optimizer: tf_keras.optimizers.Optimizer
    )

This action updates pruning steps at the end of trainig loop, and log
pruning metrics to tensorboard.

This action must be used when training a pruned model to avoid pruning error.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `export_dir` | `str` for the export directory of the pruning summaries. |
| `model` | `tf_keras.Model` model instance used for training. This will be used to assign a pruning step to each prunable weight. |
| `optimizer` | `tf_keras.optimizers.Optimizer` optimizer instance used for training. This will be used to find the current training steps. |

<br />

## Methods

### `__call__`

[View source](https://github.com/tensorflow/models/blob/v2.20.0/official/core/actions.py#L66-L73)

    __call__(
        output: orbit.runner.Output
    )

Update pruning step and log pruning summaries.

<br />

<br />

<br />

| Args ||
|---|---|
| `output` | The train output. |

<br />