未验证 提交 b5766fbf 编写于 作者: C Chen Weihang 提交者: GitHub

polish kernel type str (#42791) (#42931)

上级 d5b6eec2
......@@ -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;
}
......
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册