From 741401e9993899e17e6a571af6e6f4d199c00e2c Mon Sep 17 00:00:00 2001 From: yuyang18 Date: Tue, 15 May 2018 11:04:44 +0800 Subject: [PATCH] Update data_type --- paddle/fluid/framework/data_type.cc | 2 ++ paddle/fluid/framework/framework.proto | 2 ++ paddle/fluid/framework/op_kernel_type_test.cc | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/framework/data_type.cc b/paddle/fluid/framework/data_type.cc index 48267e1e3..b9c90cb0c 100644 --- a/paddle/fluid/framework/data_type.cc +++ b/paddle/fluid/framework/data_type.cc @@ -56,6 +56,8 @@ static DataTypeMap* InitDataTypeMap() { RegType(int, proto::VarType::INT32); RegType(int64_t, proto::VarType::INT64); RegType(bool, proto::VarType::BOOL); + RegType(size_t, proto::VarType::SIZE_T); + RegType(int16_t, proto::VarType::INT16); #undef RegType return retv; diff --git a/paddle/fluid/framework/framework.proto b/paddle/fluid/framework/framework.proto index 96f53dc1b..d2558f111 100644 --- a/paddle/fluid/framework/framework.proto +++ b/paddle/fluid/framework/framework.proto @@ -101,6 +101,8 @@ message VarType { FP16 = 4; FP32 = 5; FP64 = 6; + // Tensor is used in C++. + SIZE_T = 19; // Other types that may need additional descriptions LOD_TENSOR = 7; diff --git a/paddle/fluid/framework/op_kernel_type_test.cc b/paddle/fluid/framework/op_kernel_type_test.cc index d37ce149c..db95861c5 100644 --- a/paddle/fluid/framework/op_kernel_type_test.cc +++ b/paddle/fluid/framework/op_kernel_type_test.cc @@ -27,7 +27,7 @@ TEST(OpKernelType, ToString) { LibraryType::kCUDNN); ASSERT_EQ(paddle::framework::KernelTypeToString(op_kernel_type), - "data_type[float32]:data_layout[NCHW]:place[CPUPlace]:library_type[" + "data_type[float]:data_layout[NCHW]:place[CPUPlace]:library_type[" "CUDNN]"); } -- GitLab