# tf.data.experimental.Reducer

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 2 version](https://www.tensorflow.org/api_docs/python/tf/data/experimental/Reducer) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/data/experimental/ops/grouping.py#L443-L467) |

A reducer is used for reducing a set of elements.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.data.experimental.Reducer`](https://www.tensorflow.org/api_docs/python/tf/data/experimental/Reducer), \`tf.compat.v2.data.experimental.Reducer\`

<br />

    tf.data.experimental.Reducer(
        init_func, reduce_func, finalize_func
    )

A reducer is represented as a tuple of the three functions:

1) initialization function: key =\> initial state
2) reduce function: (old state, input) =\> new state
3) finalization function: state =\> result

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `finalize_func` | <br /> <br /> |
| `init_func` | <br /> <br /> |
| `reduce_func` | <br /> <br /> |

<br />