tf.contrib.data.padded_batch_and_drop_remainder
Stay organized with collections
Save and categorize content based on your preferences.
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
)
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 tf.contrib.data.batch_and_drop_remainder
for more details.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2020-10-01 UTC."],[],[],null,["# tf.contrib.data.padded_batch_and_drop_remainder\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/data/python/ops/batching.py#L142-L175) |\n\nA batching and padding transformation that omits the final small batch. (deprecated) \n\n tf.contrib.data.padded_batch_and_drop_remainder(\n batch_size, padded_shapes, padding_values=None\n )\n\n| **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)`](../../../tf/data/Dataset#padded_batch).\n\nLike [`tf.data.Dataset.padded_batch`](../../../tf/data/Dataset#padded_batch), this transformation combines\nconsecutive elements of this dataset into batches. However, if the batch\nsize does not evenly divide the input dataset size, this transformation will\ndrop the final smaller element.\n\nSee [`tf.contrib.data.batch_and_drop_remainder`](../../../tf/contrib/data/batch_and_drop_remainder) for more details.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `batch_size` | A [`tf.int64`](../../../tf#int64) scalar [`tf.Tensor`](../../../tf/Tensor), representing the number of consecutive elements of this dataset to combine in a single batch. |\n| `padded_shapes` | A nested structure of [`tf.TensorShape`](../../../tf/TensorShape) or [`tf.int64`](../../../tf#int64) vector tensor-like objects. See [`tf.data.Dataset.padded_batch`](../../../tf/data/Dataset#padded_batch) for details. |\n| `padding_values` | (Optional.) A nested structure of scalar-shaped [`tf.Tensor`](../../../tf/Tensor). See [`tf.data.Dataset.padded_batch`](../../../tf/data/Dataset#padded_batch) for details. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A `Dataset` transformation function, which can be passed to [`tf.data.Dataset.apply`](../../../tf/data/Dataset#apply) ||\n\n\u003cbr /\u003e"]]