Skip to content

Instantly share code, notes, and snippets.

@ntakouris
Created September 25, 2020 14:56
Show Gist options
  • Save ntakouris/48d99bda0c5bafcb4391f4fc9cd5d3a7 to your computer and use it in GitHub Desktop.
Save ntakouris/48d99bda0c5bafcb4391f4fc9cd5d3a7 to your computer and use it in GitHub Desktop.
# no parallel read performance improvement compared to interleave
dataset = tf.data.Dataset.range(2).flat_map(lambda x: tf.data.Dataset.range(x*3, (x + 1 )* 3))
for t in dataset.take(5):
print(t.numpy())
# 0
# 1
# 2
# 3
# 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment