未验证 提交 cbdc86b5 编写于 作者: Z Zhang Zheng 提交者: GitHub

Optimize the format of printing phi kernels (#48228)

上级 1022b777
...@@ -334,11 +334,17 @@ std::ostream& operator<<(std::ostream& os, KernelFactory& kernel_factory) { ...@@ -334,11 +334,17 @@ std::ostream& operator<<(std::ostream& os, KernelFactory& kernel_factory) {
os << "{"; os << "{";
bool need_comma_kernels = false; bool need_comma_kernels = false;
for (const auto& op_kernel_pair : kernel_factory.kernels()) { for (const auto& op_kernel_pair : kernel_factory.kernels()) {
if (need_comma_kernels) os << ","; if (need_comma_kernels) {
os << "\"" << op_kernel_pair.first << "\":["; os << ",";
os << std::endl;
}
os << "\"" << op_kernel_pair.first << " \":[" << std::endl;
bool need_comma_per_kernel = false; bool need_comma_per_kernel = false;
for (const auto& kernel_pair : op_kernel_pair.second) { for (const auto& kernel_pair : op_kernel_pair.second) {
if (need_comma_per_kernel) os << ","; if (need_comma_per_kernel) {
os << ",";
os << std::endl;
}
os << "{\"" << kernel_pair.first << "\":" << kernel_pair.second << "}"; os << "{\"" << kernel_pair.first << "\":" << kernel_pair.second << "}";
need_comma_per_kernel = true; need_comma_per_kernel = true;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册