From f41959ccb2d9d4c722fe8fc3351401d53bcf4900 Mon Sep 17 00:00:00 2001 From: Manjunath Kudlur Date: Fri, 6 Nov 2015 16:27:58 -0800 Subject: TensorFlow: Initial commit of TensorFlow library. TensorFlow is an open source software library for numerical computation using data flow graphs. Base CL: 107276108 --- .../core/util/saved_tensor_slice_util_test.cc | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tensorflow/core/util/saved_tensor_slice_util_test.cc (limited to 'tensorflow/core/util/saved_tensor_slice_util_test.cc') diff --git a/tensorflow/core/util/saved_tensor_slice_util_test.cc b/tensorflow/core/util/saved_tensor_slice_util_test.cc new file mode 100644 index 0000000000..2c34c903db --- /dev/null +++ b/tensorflow/core/util/saved_tensor_slice_util_test.cc @@ -0,0 +1,32 @@ +#include "tensorflow/core/util/saved_tensor_slice_util.h" + +#include +#include "tensorflow/core/lib/core/status_test_util.h" +#include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/platform/protobuf.h" + +namespace tensorflow { + +namespace checkpoint { + +namespace { + +// Testing serialization of tensor name and tensor slice in the ordered code +// format. +TEST(TensorShapeUtilTest, TensorNameSliceToOrderedCode) { + { + TensorSlice s = TensorSlice::ParseOrDie("-:-:1,3:4,5"); + string buffer = EncodeTensorNameSlice("foo", s); + string name; + s.Clear(); + TF_CHECK_OK(DecodeTensorNameSlice(buffer, &name, &s)); + EXPECT_EQ("foo", name); + EXPECT_EQ("-:-:1,3:4,5", s.DebugString()); + } +} + +} // namespace + +} // namespace checkpoint + +} // namespace tensorflow -- cgit v1.2.3