From 892293d98764c8623f7b7388517794dab07d8e62 Mon Sep 17 00:00:00 2001 From: Brennan Saeta Date: Wed, 7 Jun 2017 17:04:33 -0700 Subject: [PATCH] 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 --- tensorflow/core/kernels/iterator_ops.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/core/kernels/iterator_ops.cc b/tensorflow/core/kernels/iterator_ops.cc index c6e6634b1e9..0a82ff227e9 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 components; - bool end_of_sequence; + bool end_of_sequence = false; IteratorContext::Params params; params.env = ctx->env();