[Eager mode] Add an Eager-optimized version of the IteratorGetNext op.
authorDerek Murray <mrry@google.com>
Wed, 24 Jan 2018 22:03:09 +0000 (14:03 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Wed, 24 Jan 2018 22:10:01 +0000 (14:10 -0800)
commit3ec5b5855eb4dc781f471df2f8c981b1f0951ff2
tree907b8fa6f2b5cea12317540808047d8bbd902f50
parentf7b60fd704ced02f250b2dd0da436cf0ad9c9a8c
[Eager mode] Add an Eager-optimized version of the IteratorGetNext op.

Since in eager mode the kernel execution happens on the calling thread
(which would be blocked anyway), we can invoke the iterator
synchronously, and do not need to perform a context switch to and from
a background thread.

Improves the latency benchmarks in
//third_party/tensorflow/contrib/eager/python:datasets_test by
approximately 7us to 13us per element.

PiperOrigin-RevId: 183137488
tensorflow/contrib/eager/python/datasets.py
tensorflow/core/api_def/base_api/api_def_IteratorGetNextSync.pbtxt [new file with mode: 0644]
tensorflow/core/kernels/data/iterator_ops.cc
tensorflow/core/ops/dataset_ops.cc