load_profiler_result
载入所保存到 protobuf 文件的性能数据到内存。
参数
file_name (str) - protobuf 格式的性能数据文件路径。
返回
ProfilerResult 对象,底层存储性能数据的结构。
代码示例
>>> import paddle.profiler as profiler
>>> import paddle
>>> paddle.device.set_device('gpu')
>>> with profiler.Profiler(
... targets=[profiler.ProfilerTarget.CPU, profiler.ProfilerTarget.GPU],
... scheduler = (3, 10)) as p:
... for iter in range(10):
... #train()
... p.step()
>>> p.export('test_export_protobuf.pb', format='pb')
>>> profiler_result = profiler.load_profiler_result('test_export_protobuf.pb')