reset_profiler

paddle.fluid.profiler.reset_profiler()[源代码]

清除之前的性能分析记录。此接口不能和 cuda_profiler 一起使用 ,但它可以和 start_profilerstop_profilerprofiler 一起使用。

代码示例

  1. import paddle.fluid as fluid
  2. import paddle.fluid.profiler as profiler
  3. with profiler.profiler('CPU', 'total', '/tmp/profile'):
  4. for iter in range(10):
  5. if iter == 2:
  6. profiler.reset_profiler()
  7. # ...