profiler#

class ProfilerOptions(options_str)[源代码]#

基类:object

Use a string to initialize a ProfilerOptions. The string should be in the format: "key1=value1;key2=value;key3=value3". For example:

"profile_path=model.profile" "batch_range=[50, 60]; profile_path=model.profile" "batch_range=[50, 60]; tracer_option=OpDetail; profile_path=model.profile"

ProfilerOptions supports following key-value pair:

batch_range - a integer list, e.g. [100, 110]. state - a string, the optional values are 'CPU', 'GPU' or 'All'. sorted_key - a string, the optional values are 'calls', 'total',

'max', 'min' or 'ave.

tracer_option - a string, the optional values are 'Default', 'OpDetail',

'AllOpDetail'.

profile_path - a string, the path to save the serialized profile data,

which can be used to generate a timeline.

exit_on_finished - a boolean. record_shapes - a boolean.

add_profiler_step(options_str=None)[源代码]#

Enable the operator-level timing using PaddlePaddle's profiler. The profiler uses a independent variable to count the profiler steps. One call of this function is treated as a profiler step. :param profiler_options - a string to initialize the ProfilerOptions.: Default is None, and the profiler is disabled.