The test_dataset
is defined as:
test_dataset = tf.data.TFRecordDataset([test_tfrecords])
test_dataset = test_dataset.map(map_f)
test_dataset = test_dataset.repeat(1)
test_dataset = test_dataset.batch(1)
For fetching the first 100 elements:
for test in test_dataset.take(100):
pass
But how to fetch elements in index range
between 50 and 150?
for test in test_dataset.take([50-150]):
pass
CodePudding user response:
Try tf.data.Dataset.skip
:
for test in test_dataset.skip(50).take(100):
pass