Elements of the Dataset are grouped together by length and then are padded
This is useful for sequence tasks in which the elements have variable length.
Grouping together elements that have similar lengths reduces the total
fraction of padding in a batch which increases training step efficiency.
function from element in Dataset to tf.int32,
determines the length of the element, which will determine the bucket it
list<int>, upper length boundaries of the buckets.
list<int>, batch size per bucket. Length should be
len(bucket_boundaries) + 1.
Nested structure of tf.TensorShape to pass to
tf.data.Dataset.padded_batch. If not provided, will use
dataset.output_shapes, which will result in variable length dimensions
being padded out to the maximum length in each batch.
bool, if False, will pad dimensions with unknown
size to maximum length in batch. If True, will pad dimensions with
unknown size to bucket boundary minus 1 (i.e., the maximum length in each
bucket), and caller must ensure that the source Dataset does not contain
any elements with length longer than max(bucket_boundaries).
bool, indicates whether to pad the batch features (features
need to be either of type tf.sparse.SparseTensor or of same shape).
(Optional.) A tf.bool scalar tf.Tensor, representing
whether the last batch should be dropped in the case it has fewer than
batch_size elements; the default behavior is not to drop the smaller