paddlespeech.t2s.utils.profiler 模块

class paddlespeech.t2s.utils.profiler.ProfilerOptions(options_str)[来源]

基础: object

使用字符串初始化 ProfilerOptions。 该字符串应采用以下格式:"key1=value1;key2=value;key3=value3"。 例如:

"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 - 一个整数列表,例如 [100, 110]. state - 一个字符串,可选值为 'CPU'、'GPU' 或 'All'. sorted_key - 一个字符串,可选值为 'calls'、'total',

'max'、'min' 或者 'ave.

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

'AllOpDetail'.

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

可以用于生成时间线。

exit_on_finished - 一个布尔值。

paddlespeech.t2s.utils.profiler.add_profiler_step(options_str=None)[来源]

使用PaddlePaddle的分析器启用操作级别的计时。 分析器使用一个独立的变量来计算分析步骤。 此函数的一个调用被视为一个分析步骤。 参数:

profiler_options - a string to initialize the ProfilerOptions.

默认值为 None,分析器已禁用。