aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Brennan Saeta <saeta@google.com>2017-06-07 17:04:33 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-06-07 17:08:34 -0700
commit892293d98764c8623f7b7388517794dab07d8e62 (patch)
tree34ef637aaee4eb9f9f69f2f889ec73b4aa759708
parent187404eac001d67e8f0b3a7aeac2fc2b2ba65e0a (diff)
Set a default for datasets end_of_sequence.
While all datasets carefully set the end_of_sequence to true at the appropriate time, some datasets might forget to set it to false in the normal case. In order to avoid potential undefined behavior, we set the end_of_sequence variable to be false by default. PiperOrigin-RevId: 158337799
-rw-r--r--tensorflow/core/kernels/iterator_ops.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/tensorflow/core/kernels/iterator_ops.cc b/tensorflow/core/kernels/iterator_ops.cc
index c6e6634b1e..0a82ff227e 100644
--- a/tensorflow/core/kernels/iterator_ops.cc
+++ b/tensorflow/core/kernels/iterator_ops.cc
@@ -307,7 +307,7 @@ class IteratorGetNextOp : public AsyncOpKernel {
core::ScopedUnref unref_iterator(iterator);
std::vector<Tensor> components;
- bool end_of_sequence;
+ bool end_of_sequence = false;
IteratorContext::Params params;
params.env = ctx->env();