diff options
author | Manjunath Kudlur <keveman@gmail.com> | 2015-11-06 16:27:58 -0800 |
---|---|---|
committer | Manjunath Kudlur <keveman@gmail.com> | 2015-11-06 16:27:58 -0800 |
commit | f41959ccb2d9d4c722fe8fc3351401d53bcf4900 (patch) | |
tree | ef0ca22cb2a5ac4bdec9d080d8e0788a53ed496d /tensorflow/core/util/saved_tensor_slice_util_test.cc |
TensorFlow: Initial commit of TensorFlow library.
TensorFlow is an open source software library for numerical computation
using data flow graphs.
Base CL: 107276108
Diffstat (limited to 'tensorflow/core/util/saved_tensor_slice_util_test.cc')
-rw-r--r-- | tensorflow/core/util/saved_tensor_slice_util_test.cc | 32 |
1 files changed, 32 insertions, 0 deletions
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 <gtest/gtest.h> +#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 |