MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / unbatch

Function unbatch

tensorflow/contrib/data/python/ops/batching.py:78–99  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

76
77@deprecation.deprecated(None, "Use `tf.data.experimental.unbatch()`.")
78def unbatch():
79 """Splits elements of a dataset into multiple elements on the batch dimension.
80
81 For example, if elements of the dataset are shaped `[B, a0, a1, ...]`,
82 where `B` may vary for each input element, then for each element in the
83 dataset, the unbatched dataset will contain `B` consecutive elements
84 of shape `[a0, a1, ...]`.
85
86 ```python
87 # NOTE: The following example uses `{ ... }` to represent the contents
88 # of a dataset.
89 a = { ['a', 'b', 'c'], ['a', 'b'], ['a', 'b', 'c', 'd'] }
90
91 a.apply(tf.data.experimental.unbatch()) == {
92 'a', 'b', 'c', 'a', 'b', 'a', 'b', 'c', 'd'}
93 ```
94
95 Returns:
96 A `Dataset` transformation function, which can be passed to
97 `tf.data.Dataset.apply`.
98 """
99 return batching.unbatch()
100
101
102@deprecation.deprecated(

Callers

nothing calls this directly

Calls 1

unbatchMethod · 0.80

Tested by

no test coverage detected