# tfma.exporter.LatestExporter

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/model-analysis/blob/v0.46.0/tensorflow_model_analysis/eval_saved_model/exporter.py#L151-L243) |

This class regularly exports the EvalSavedModel.

    tfma.exporter.LatestExporter(
        *args, **kwargs
    )

In addition to exporting, this class also garbage collects stale exports.

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `name` | Directory name. <br /> A directory name under the export base directory where exports of this type are written. Should not be `None` nor empty. |

<br />

## Methods

### `export`

[View source](https://github.com/tensorflow/model-analysis/blob/v0.46.0/tensorflow_model_analysis/eval_saved_model/exporter.py#L204-L212)

    export(
        estimator: tf_estimator.Estimator,
        export_path: str,
        checkpoint_path: Optional[str],
        eval_result: Optional[bytes],
        is_the_final_export: bool
    ) -> bytes

Exports the given `Estimator` to a specific format.

<br />

<br />

<br />

| Args ||
|---|---|
| `estimator` | the `Estimator` to export. |
| `export_path` | A string containing a directory where to write the export. |
| `checkpoint_path` | The checkpoint path to export. |
| `eval_result` | The output of `Estimator.evaluate` on this checkpoint. |
| `is_the_final_export` | This boolean is True when this is an export in the end of training. It is False for the intermediate exports during the training. When passing `Exporter` to `tf.estimator.train_and_evaluate` `is_the_final_export` is always False if `TrainSpec.max_steps` is `None`. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| The string path to the exported directory or `None` if export is skipped. ||

<br />