reset_profiler

paddle.utils.profiler. reset_profiler ( ) [source]

Clear the previous time record. It works for fluid.profiler.start_profiler, fluid.profiler.stop_profiler, and fluid.profiler.profiler.

Examples

# required: gpu
import paddle.fluid as fluid
import paddle.fluid.profiler as profiler
with profiler.profiler('CPU', 'total', '/tmp/profile'):
    for iter in range(10):
        if iter == 2:
            profiler.reset_profiler()
        # ...