diff options
author | 2018-03-28 14:04:01 -0700 | |
---|---|---|
committer | 2018-03-28 14:07:18 -0700 | |
commit | d355f4e2644b68ea643f573c564936ec23b93787 (patch) | |
tree | 19ec2cfc40018c38bb5037353981f64f391a5393 /tensorflow/contrib/data/__init__.py | |
parent | 70666858800a55585ae2775f97a1731db305388a (diff) |
[tf.data] Autotune prefetch buffer sizes
In order to make it easier for tf.data users to achieve
high performance with their input pipelines, this change adds
the ability for the prefetch op to automatically tune its buffer
size.
To use the auto-tuning configuration of the `prefetch` transformation,
simply skip passing in a buffer size. Example:
```python
dataset = # ...
dataset = dataset.prefetch() # Look ma, no buffer value req'd!
```
PiperOrigin-RevId: 190829736
Diffstat (limited to 'tensorflow/contrib/data/__init__.py')
-rw-r--r-- | tensorflow/contrib/data/__init__.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tensorflow/contrib/data/__init__.py b/tensorflow/contrib/data/__init__.py index 766721d8d2..7c3a9f82ff 100644 --- a/tensorflow/contrib/data/__init__.py +++ b/tensorflow/contrib/data/__init__.py @@ -82,3 +82,6 @@ from tensorflow.python.ops.parsing_ops import parse_single_example_v2 as parse_s from tensorflow.python.util.all_util import remove_undocumented remove_undocumented(__name__) + +# A constant that can be used to enable auto-tuning. +AUTOTUNE = -1 |