Skip to content

Commit

Permalink
put_record_event_in_python_on_timeline_python (#42555)
Browse files Browse the repository at this point in the history
* put_record_event_in_python_on_timeline_python

* fix
  • Loading branch information
rainyfly committed May 16, 2022
1 parent e052fde commit f7bcbc8
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions python/paddle/profiler/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

_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
]


Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -101,8 +101,6 @@ def begin(self):
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):
Expand Down

1 comment on commit f7bcbc8

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.