# tf.contrib.data.reduce_dataset

<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/get_single_element.py#L68-L87) |

Returns the result of reducing the `dataset` using `reducer`. (deprecated)

    tf.contrib.data.reduce_dataset(
        dataset, reducer
    )

> [!WARNING]
> **Warning:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use [`tf.data.Dataset.reduce(...)`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/data/Dataset#reduce).

<br />

<br />

<br />

| ## Args ||
|---|---|
| `dataset` | A [`tf.data.Dataset`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/data/Dataset) object. |
| `reducer` | A [`tf.data.experimental.Reducer`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/data/experimental/Reducer) object representing the reduce logic. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A nested structure of [`tf.Tensor`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/Tensor) objects, corresponding to the result of reducing `dataset` using `reducer`. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `TypeError` | if `dataset` is not a [`tf.data.Dataset`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/data/Dataset) object. |

<br />