Skip to content

Commit

Permalink
add args in the last position
Browse files Browse the repository at this point in the history
  • Loading branch information
kuizhiqing committed Aug 19, 2022
1 parent 2c6aec9 commit abfba42
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
13 changes: 7 additions & 6 deletions python/paddle/profiler/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class SummaryView(Enum):
KernelView = 4
OperatorView = 5
MemoryView = 6
UDFView = 7
MemoryManipulationView = 7
UDFView = 8


class ProfilerState(Enum):
Expand Down Expand Up @@ -749,17 +750,17 @@ def summary(self,
sorted_by=SortedKeys.CPUTotal,
op_detail=True,
thread_sep=False,
views=None,
time_unit='ms'):
time_unit='ms',
views=None):
r"""
Print the Summary table. Currently support overview, model, distributed, operator, memory manipulation and userdefined summary.
Args:
sorted_by( :ref:`SortedKeys <api_paddle_profiler_SortedKeys>` , optional): how to rank the op table items, default value is SortedKeys.CPUTotal.
op_detail(bool, optional): expand each operator detail information, default value is True.
thread_sep(bool, optional): print op table each thread, default value is False.
views(list[SummaryView], optional): summary tables to print, default to None means all views to be printed.
time_unit(str, optional): time unit for display, can be chosen form ['s', 'ms', 'us', 'ns'], default value is 'ms'.
views(list[SummaryView], optional): summary tables to print, default to None means all views to be printed.
Examples:
.. code-block:: python
Expand Down Expand Up @@ -787,8 +788,8 @@ def summary(self,
sorted_by=sorted_by,
op_detail=op_detail,
thread_sep=thread_sep,
views=views,
time_unit=time_unit))
time_unit=time_unit,
views=views))


def get_profiler(config_path):
Expand Down
6 changes: 3 additions & 3 deletions python/paddle/profiler/profiler_statistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,10 +698,10 @@ def _build_table(statistic_data,
sorted_by=SortedKeys.CPUTotal,
op_detail=True,
thread_sep=False,
views=None,
time_unit='ms',
row_limit=100,
max_src_column_width=75):
max_src_column_width=75,
views=None):

from .profiler import SummaryView
"""Prints a summary of events."""
Expand Down Expand Up @@ -1415,7 +1415,7 @@ def format_ratio(ratio, indent=0):
append('')
append('')

if views is None or SummaryView.MemoryView in views:
if views is None or SummaryView.MemoryManipulationView in views:

###### Print Memory Manipulation Summary Report ######
if statistic_data.event_summary.memory_manipulation_items:
Expand Down

0 comments on commit abfba42

Please sign in to comment.