tf.contrib.data.unbatch

tf.contrib.data.unbatch()

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

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

Splits elements of a dataset into multiple elements on the batch dimension.

For example, if elements of the dataset are shaped [B, a0, a1, ...], where B may vary for each input element, then for each element in the dataset, the unbatched dataset will contain B consecutive elements of shape [a0, a1, ...].

# NOTE: The following example uses `{ ... }` to represent the contents
# of a dataset.
a = { ['a', 'b', 'c'], ['a', 'b'], ['a', 'b', 'c', 'd'] }

a.apply(tf.contrib.data.unbatch()) == {
    'a', 'b', 'c', 'a', 'b', 'a', 'b', 'c', 'd'}

Returns:

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