Browse Source

!5343 Delete __del__func in Profiler.

Merge pull request !5343 from yuximiao/master
tags/v1.0.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
86c39d34ad
1 changed files with 3 additions and 5 deletions
  1. +3
    -5
      mindspore/profiler/profiling.py

+ 3
- 5
mindspore/profiler/profiling.py View File

@@ -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.



Loading…
Cancel
Save