diff options
author | Derek Murray <mrry@google.com> | 2017-11-20 16:10:19 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-11-20 16:13:35 -0800 |
commit | 1ac6383d976f0b0b099a340820c36b825126fc9c (patch) | |
tree | 4cdc97377ffc5f2cfcc090678868106722a4b158 /tensorflow/core/kernels/priority_queue.cc | |
parent | ab400e98f1a206aa57e219d00dc9856d151ad676 (diff) |
Add a fast path for batching strings when it is possible to move them.
This optimization applies to any TensorFlow queues that contain
strings, plus the `Dataset.batch()` transformation.
PiperOrigin-RevId: 176432783
Diffstat (limited to 'tensorflow/core/kernels/priority_queue.cc')
-rw-r--r-- | tensorflow/core/kernels/priority_queue.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tensorflow/core/kernels/priority_queue.cc b/tensorflow/core/kernels/priority_queue.cc index 4c406fc1ed..5c487edbe3 100644 --- a/tensorflow/core/kernels/priority_queue.cc +++ b/tensorflow/core/kernels/priority_queue.cc @@ -22,6 +22,7 @@ limitations under the License. #include "tensorflow/core/framework/tensor.h" #include "tensorflow/core/framework/tensor_shape.h" #include "tensorflow/core/framework/types.h" +#include "tensorflow/core/kernels/batch_util.h" #include "tensorflow/core/kernels/priority_queue.h" #include "tensorflow/core/kernels/queue_base.h" #include "tensorflow/core/lib/core/errors.h" @@ -358,8 +359,8 @@ void PriorityQueue::TryDequeueMany(int num_elements, OpKernelContext* ctx, const int index = attempt->tuple[0].dim_size(0) - attempt->elements_requested; for (int i = 0; i < num_components(); ++i) { - attempt->context->SetStatus( - CopyElementToSlice(tuple[i], &attempt->tuple[i], index)); + attempt->context->SetStatus(batch_util::CopyElementToSlice( + std::move(tuple[i]), &attempt->tuple[i], index)); if (!attempt->context->status().ok()) return kComplete; } tuple.clear(); |