未验证 提交 9e3cfdfa 编写于 作者: C chenjian 提交者: GitHub

fix kenrel name apperance (#42071)

上级 8a6456db
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
# limitations under the License. # limitations under the License.
import collections import collections
from enum import Enum from enum import Enum
import re
from paddle.fluid.core import TracerEventType from paddle.fluid.core import TracerEventType
...@@ -1317,10 +1318,11 @@ def _build_table(statistic_data, ...@@ -1317,10 +1318,11 @@ def _build_table(statistic_data,
append(header_sep) append(header_sep)
append(row_format.format(*headers)) append(row_format.format(*headers))
append(header_sep) append(header_sep)
kernel_name_pattern = re.compile('(.+?)(<.*>)(\(.*\))')
for row_values in all_row_values: for row_values in all_row_values:
indx = row_values[0].find('(') match = kernel_name_pattern.match(row_values[0])
if indx != -1: if match:
name = row_values[0][:indx] name = match.group(1) + match.group(2)
else: else:
name = row_values[0] name = row_values[0]
if len(name) > name_column_width: if len(name) > name_column_width:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册