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

put_record_event_in_python_on_timeline_python (#42555) (#42790)

* put_record_event_in_python_on_timeline_python

* fix
上级 07029e0c
......@@ -25,9 +25,9 @@ _has_optimizer_wrapped = False
_AllowedEventTypeList = [
TracerEventType.Dataloader, TracerEventType.ProfileStep,
TracerEventType.UserDefined, TracerEventType.Forward,
TracerEventType.Backward, TracerEventType.Optimization,
TracerEventType.PythonOp, TracerEventType.PythonUserDefined
TracerEventType.Forward, TracerEventType.Backward,
TracerEventType.Optimization, TracerEventType.PythonOp,
TracerEventType.PythonUserDefined
]
......@@ -37,7 +37,7 @@ class RecordEvent(ContextDecorator):
Args:
name(str): Name of the record event
event_type(TracerEventType, optional): Optional, default value is TracerEventType.UserDefined. It is reserved for internal purpose, and it is better not to specify this parameter.
event_type(TracerEventType, optional): Optional, default value is TracerEventType.PythonUserDefined. It is reserved for internal purpose, and it is better not to specify this parameter.
Examples:
.. code-block:: python
......@@ -64,7 +64,7 @@ class RecordEvent(ContextDecorator):
def __init__(self,
name: str,
event_type: TracerEventType=TracerEventType.UserDefined):
event_type: TracerEventType=TracerEventType.PythonUserDefined):
self.name = name
self.event_type = event_type
self.event = None
......@@ -101,8 +101,6 @@ class RecordEvent(ContextDecorator):
can be recorded.".format(*_AllowedEventTypeList))
self.event = None
else:
if self.event_type == TracerEventType.UserDefined:
self.event_type == TracerEventType.PythonUserDefined
self.event = _RecordEvent(self.name, self.event_type)
def end(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册