tf.contrib.data.unbatch
Stay organized with collections
Save and categorize content based on your preferences.
Splits elements of a dataset into multiple elements on the batch dimension. (deprecated)
tf.contrib.data.unbatch()
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.data.experimental.unbatch()) == {
'a', 'b', 'c', 'a', 'b', 'a', 'b', 'c', 'd'}
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.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.contrib.data.unbatch\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#L77-L99) |\n\nSplits elements of a dataset into multiple elements on the batch dimension. (deprecated) \n\n tf.contrib.data.unbatch()\n\n| **Warning:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use [`tf.data.experimental.unbatch()`](../../../tf/data/experimental/unbatch).\n\nFor example, if elements of the dataset are shaped `[B, a0, a1, ...]`,\nwhere `B` may vary for each input element, then for each element in the\ndataset, the unbatched dataset will contain `B` consecutive elements\nof shape `[a0, a1, ...]`. \n\n # NOTE: The following example uses `{ ... }` to represent the contents\n # of a dataset.\n a = { ['a', 'b', 'c'], ['a', 'b'], ['a', 'b', 'c', 'd'] }\n\n a.apply(tf.data.experimental.unbatch()) == {\n 'a', 'b', 'c', 'a', 'b', 'a', 'b', 'c', 'd'}\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"]]