# tf.contrib.data.Reducer

<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/data/python/ops/grouping.py#L146-L157) |

A reducer is used for reducing a set of elements.

Inherits From: [`Reducer`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/data/experimental/Reducer)

    tf.contrib.data.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 />