diff --git a/paddle/fluid/framework/op_kernel_type.h b/paddle/fluid/framework/op_kernel_type.h index a2e9d972c48bc6cccff84f8f6539718cec448bb5..8b1f0942f820a3cb3152431fbc38f0acf3cae5ef 100644 --- a/paddle/fluid/framework/op_kernel_type.h +++ b/paddle/fluid/framework/op_kernel_type.h @@ -82,9 +82,9 @@ class OpKernelType { inline std::ostream& operator<<(std::ostream& os, const OpKernelType& kernel_key) { - os << "data_type[" << kernel_key.data_type_ << "]:data_layout[" - << kernel_key.data_layout_ << "]:place[" << kernel_key.place_ - << "]:library_type[" << kernel_key.library_type_ << "]"; + os << "{data_type[" << kernel_key.data_type_ << "]; data_layout[" + << kernel_key.data_layout_ << "]; place[" << kernel_key.place_ + << "]; library_type[" << kernel_key.library_type_ << "]}"; return os; } diff --git a/paddle/fluid/framework/op_kernel_type_test.cc b/paddle/fluid/framework/op_kernel_type_test.cc index 3879a7957600d69476d00b3e23d69d2d43c1b10a..20f695d40568ed06676b672d46727821f59bfc25 100644 --- a/paddle/fluid/framework/op_kernel_type_test.cc +++ b/paddle/fluid/framework/op_kernel_type_test.cc @@ -27,16 +27,15 @@ TEST(OpKernelType, ToString) { LibraryType::kCUDNN); ASSERT_EQ(paddle::framework::KernelTypeToString(op_kernel_type), - "data_type[float]:data_layout[NCHW]:place[Place(cpu)]:library_type[" - "CUDNN]"); + "{data_type[float]; data_layout[NCHW]; place[Place(cpu)]; " + "library_type[CUDNN]}"); using CUDAPlace = paddle::platform::CUDAPlace; OpKernelType op_kernel_type2(DataType::FP16, CUDAPlace(0), DataLayout::kNCHW, LibraryType::kCUDNN); ASSERT_EQ(paddle::framework::KernelTypeToString(op_kernel_type2), - "data_type[::paddle::platform::float16]:data_layout[NCHW]:place[" - "Place(gpu:0)]:library_" - "type[CUDNN]"); + "{data_type[::paddle::platform::float16]; data_layout[NCHW]; " + "place[Place(gpu:0)]; library_type[CUDNN]}"); } TEST(OpKernelType, Hash) {