# tf.contrib.data.padded_batch_and_drop_remainder

<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/batching.py#L142-L175) |

A batching and padding transformation that omits the final small batch. (deprecated)

    tf.contrib.data.padded_batch_and_drop_remainder(
        batch_size, padded_shapes, padding_values=None
    )

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

Like [`tf.data.Dataset.padded_batch`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/data/Dataset#padded_batch), this transformation combines
consecutive elements of this dataset into batches. However, if the batch
size does not evenly divide the input dataset size, this transformation will
drop the final smaller element.

See [`tf.contrib.data.batch_and_drop_remainder`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/contrib/data/batch_and_drop_remainder) for more details.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `batch_size` | A [`tf.int64`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf#int64) scalar [`tf.Tensor`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/Tensor), representing the number of consecutive elements of this dataset to combine in a single batch. |
| `padded_shapes` | A nested structure of [`tf.TensorShape`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/TensorShape) or [`tf.int64`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf#int64) vector tensor-like objects. See [`tf.data.Dataset.padded_batch`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/data/Dataset#padded_batch) for details. |
| `padding_values` | (Optional.) A nested structure of scalar-shaped [`tf.Tensor`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/Tensor). See [`tf.data.Dataset.padded_batch`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/data/Dataset#padded_batch) for details. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Dataset` transformation function, which can be passed to [`tf.data.Dataset.apply`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/data/Dataset#apply) ||

<br />