op_freq_statistic

paddle.fluid.contrib.op_frequence. op_freq_statistic ( program ) [source]

Statistics of Op frequency.

Parameters

program (Program) – The current Program.

Returns

the single op frequency. adj_2_op_freq(dict): the two adjacent ops frequency.

Return type

uni_op_freq(dict)

Examples

>>> import paddle.fluid as fluid
>>> uni_op_freq, adj_2_op_freq = fluid.contrib.op_freq_statistic(
>>>        fluid.default_main_program())
>>> for op_type, op_num in uni_op_freq:
>>>     print("%s         %d" % (op_type, op_num))
>>> for op_type, op_num in adj_2_op_freq:
>>>     print("%s         %d" % (op_type, op_num))