提交 72722843 编写于 作者: Y yuximiao

fix __del__ in Profiler

上级 c1618f0b
......@@ -205,6 +205,9 @@ class Profiler:
except (ProfilerIOException, ProfilerFileNotFoundException, RuntimeError) as err:
logger.warning('Fail to write timeline data: %s', err)
os.environ['PROFILING_MODE'] = str("false")
context.set_context(enable_profiling=False)
def _analyse_step_trace(self, source_path, framework_parser):
"""
Analyse step trace data and save the result.
......@@ -275,11 +278,6 @@ class Profiler:
timeline_analyser.write_timeline()
timeline_analyser.write_timeline_summary()
def __del__(self):
"""Disable the profiling collection service, called after training."""
os.environ['PROFILING_MODE'] = str("false")
context.set_context(enable_profiling=False)
def _get_profiling_job_id(self):
"""Get profiling job id, which was generated by ada service.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册