<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/metrics/__init__.py#L134-L144) |

Serializes metric function or `Metric` instance.

    tf.keras.metrics.serialize(
        metric
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `metric` | A Keras `Metric` instance or a metric function. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Metric configuration dictionary. ||

<br />