W3cubDocs

/TensorFlow Python

tf.contrib.data.padded_batch_and_drop_remainder

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

Defined in tensorflow/contrib/data/python/ops/batching.py.

See the guide: Dataset Input Pipeline > Transformations on existing datasets

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

Like 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 <a href="../../../tf/contrib/data/batch_and_drop_remainder"><code>tf.contrib.data.batch_and_drop_remainder</code></a> for more details.

Args:

Returns:

A Dataset transformation function, which can be passed to tf.data.Dataset.apply

© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/data/padded_batch_and_drop_remainder