diff options
author | 2017-06-07 17:04:33 -0700 | |
---|---|---|
committer | 2017-06-07 17:08:34 -0700 | |
commit | 892293d98764c8623f7b7388517794dab07d8e62 (patch) | |
tree | 34ef637aaee4eb9f9f69f2f889ec73b4aa759708 | |
parent | 187404eac001d67e8f0b3a7aeac2fc2b2ba65e0a (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.cc | 2 |
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(); |