Merge pull request #38579 from NeerajBhadani:patch-1
PiperOrigin-RevId: 310177402 Change-Id: Ie4dff812a73da2311fe075955db353d1e8c17b83
This commit is contained in:
commit
638ba01886
@ -1657,7 +1657,8 @@ name=None))
|
||||
stays the same. For example, to flatten a dataset of batches into a
|
||||
dataset of their elements:
|
||||
|
||||
>>> dataset = Dataset.from_tensor_slices([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
|
||||
>>> dataset = tf.data.Dataset.from_tensor_slices(
|
||||
... [[1, 2, 3], [4, 5, 6], [7, 8, 9]])
|
||||
>>> dataset = dataset.flat_map(lambda x: Dataset.from_tensor_slices(x))
|
||||
>>> list(dataset.as_numpy_iterator())
|
||||
[1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||
|
Loading…
Reference in New Issue
Block a user