From f69a9c29a5d806673dddc6736aa17310af208d7f Mon Sep 17 00:00:00 2001 From: Abhinav Arora Date: Wed, 14 Feb 2018 11:24:04 -0800 Subject: [PATCH] Fix data_layout_transform_test.cc and op_kernel_type_test.cc --- paddle/fluid/framework/data_layout_transform_test.cc | 4 ++-- paddle/fluid/framework/op_kernel_type_test.cc | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/paddle/fluid/framework/data_layout_transform_test.cc b/paddle/fluid/framework/data_layout_transform_test.cc index 96746e397e0..dd17cac0e10 100644 --- a/paddle/fluid/framework/data_layout_transform_test.cc +++ b/paddle/fluid/framework/data_layout_transform_test.cc @@ -27,9 +27,9 @@ TEST(DataTransform, DataLayoutFunction) { in.mutable_data(make_ddim({2, 3, 1, 2}), place); in.set_layout(DataLayout::kNHWC); - auto kernel_nhwc = OpKernelType(proto::VarType::Type::FP32, place, + auto kernel_nhwc = OpKernelType(proto::VarType::FP32, place, DataLayout::kNHWC, LibraryType::kPlain); - auto kernel_ncwh = OpKernelType(proto::VarType::Type::FP32, place, + auto kernel_ncwh = OpKernelType(proto::VarType::FP32, place, DataLayout::kNCHW, LibraryType::kPlain); TransDataLayout(kernel_nhwc, kernel_ncwh, in, &out); diff --git a/paddle/fluid/framework/op_kernel_type_test.cc b/paddle/fluid/framework/op_kernel_type_test.cc index 8d20b3766a3..ac5fcb26b92 100644 --- a/paddle/fluid/framework/op_kernel_type_test.cc +++ b/paddle/fluid/framework/op_kernel_type_test.cc @@ -23,7 +23,7 @@ TEST(OpKernelType, ToString) { using DataLayout = paddle::framework::DataLayout; using LibraryType = paddle::framework::LibraryType; - OpKernelType op_kernel_type(proto::VarType::FP32, CPUPlace(), DataLayout::kNCHW, + OpKernelType op_kernel_type(DataType::FP32, CPUPlace(), DataLayout::kNCHW, LibraryType::kCUDNN); ASSERT_EQ(paddle::framework::KernelTypeToString(op_kernel_type), @@ -39,9 +39,9 @@ TEST(OpKernelType, Hash) { using DataLayout = paddle::framework::DataLayout; using LibraryType = paddle::framework::LibraryType; - OpKernelType op_kernel_type_1(proto::VarType::FP32, CPUPlace(), DataLayout::kNCHW, + OpKernelType op_kernel_type_1(DataType::FP32, CPUPlace(), DataLayout::kNCHW, LibraryType::kCUDNN); - OpKernelType op_kernel_type_2(proto::VarType::FP32, CUDAPlace(0), DataLayout::kNCHW, + OpKernelType op_kernel_type_2(DataType::FP32, CUDAPlace(0), DataLayout::kNCHW, LibraryType::kCUDNN); OpKernelType::Hash hasher; -- GitLab