Skip to content

Commit

Permalink
Merge pull request #38579 from NeerajBhadani:patch-1
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 310177402
Change-Id: Ie4dff812a73da2311fe075955db353d1e8c17b83
  • Loading branch information
tensorflower-gardener committed May 6, 2020
2 parents 4823ee3 + e492c99 commit 638ba01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tensorflow/python/data/ops/dataset_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,8 @@ def flat_map(self, map_func):
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]
Expand Down

0 comments on commit 638ba01

Please sign in to comment.