diff options
author | 2017-12-04 15:27:01 -0800 | |
---|---|---|
committer | 2017-12-04 15:30:14 -0800 | |
commit | 0946c24012c9e26670d2e29679df13bf6f002fa8 (patch) | |
tree | 3457ef1eff402de293ab12f1c018efa0b5e3ec8d /tensorflow/contrib/data/python/ops/readers.py | |
parent | e12c032397c54f41731d6924d38854eb2bbf5b4d (diff) |
Add a single capacity prefetch to `tf.contrib.data.read_batch_features`.
PiperOrigin-RevId: 177877751
Diffstat (limited to 'tensorflow/contrib/data/python/ops/readers.py')
-rw-r--r-- | tensorflow/contrib/data/python/ops/readers.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tensorflow/contrib/data/python/ops/readers.py b/tensorflow/contrib/data/python/ops/readers.py index acb7a43211..347e5edc7b 100644 --- a/tensorflow/contrib/data/python/ops/readers.py +++ b/tensorflow/contrib/data/python/ops/readers.py @@ -179,6 +179,7 @@ def read_batch_features(file_pattern, dataset = dataset.shuffle(capacity) dataset = dataset.batch(batch_size) dataset = dataset.map(lambda x: parsing_ops.parse_example(x, features)) + dataset = dataset.prefetch(1) iterator = dataset.make_one_shot_iterator() outputs = iterator.get_next() return outputs |