aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/util/tensor_slice_writer_test.cc
diff options
context:
space:
mode:
authorGravatar Geoffrey Irving <geoffreyi@google.com>2016-02-10 13:52:47 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-02-10 16:02:39 -0800
commitea92856334a74519055a4e22aba7ceee5dd039a2 (patch)
tree5542d52c1be0a7802866ee83be77cdf82d4fc32d /tensorflow/core/util/tensor_slice_writer_test.cc
parentb2757fb5797252bb1ef12bbf04be796cc83000cc (diff)
Add versions to checkpoints
Checkpoints now have a version scheme analogous to that for GraphDefs. We have no plans to ever deprecate a checkpoint version, but it's good to have the scheme in place in case we need to. Change: 114364388
Diffstat (limited to 'tensorflow/core/util/tensor_slice_writer_test.cc')
-rw-r--r--tensorflow/core/util/tensor_slice_writer_test.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/tensorflow/core/util/tensor_slice_writer_test.cc b/tensorflow/core/util/tensor_slice_writer_test.cc
index 625ad1b212..b7996b223c 100644
--- a/tensorflow/core/util/tensor_slice_writer_test.cc
+++ b/tensorflow/core/util/tensor_slice_writer_test.cc
@@ -20,6 +20,7 @@ limitations under the License.
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/protobuf.h"
#include "tensorflow/core/platform/test.h"
+#include "tensorflow/core/public/version.h"
#include "tensorflow/core/util/saved_tensor_slice_util.h"
#include "tensorflow/core/util/tensor_slice_reader.h"
@@ -148,6 +149,11 @@ void TensorSliceWriteTestHelper::CheckEntries(const string& fname) {
// We also expect two entries for the tensors
EXPECT_TRUE(sts.has_meta());
EXPECT_EQ(4, sts.meta().tensor_size());
+ // We should have written nontrivial version information
+ EXPECT_LT(0, TF_CHECKPOINT_VERSION);
+ EXPECT_EQ(TF_CHECKPOINT_VERSION, sts.meta().versions().producer());
+ EXPECT_EQ(TF_CHECKPOINT_VERSION_MIN_CONSUMER,
+ sts.meta().versions().min_consumer());
// We don't expect any data in the first block.
EXPECT_FALSE(sts.has_data());
// The two tensors should be stored in the same order as they are first