Browse Source

!9831 Bugfix about the lifetime of TraceGuard

From: @dayschan
Reviewed-by: @irmo,@gaoxiong1,@ckey_dou
Signed-off-by: @ckey_dou
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
6ae9353168
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      mindspore/ccsrc/vm/segment_runner.cc

+ 6
- 2
mindspore/ccsrc/vm/segment_runner.cc View File

@@ -115,8 +115,12 @@ std::tuple<FuncGraphPtr, AnfNodePtrList, AnfNodePtrList> TransformSegmentToAnfGr
if (lst.empty()) {
MS_LOG(EXCEPTION) << "Input anf node list is empty";
}
TraceGuard guard(std::make_shared<TraceSegmentTransform>(lst[0]->cast<CNodePtr>()->func_graph()->debug_info()));
auto fg = std::make_shared<FuncGraph>();
FuncGraphPtr fg = nullptr;
{
// limit the lifetime of guard.
TraceGuard guard(std::make_shared<TraceSegmentTransform>(lst[0]->cast<CNodePtr>()->func_graph()->debug_info()));
fg = std::make_shared<FuncGraph>();
}
AnfNodePtrList inputs;
AnfNodePtrToAnfNodePtrMap eqv;
// Merge CNodes into a AnfGraph that represents a linear instruction segment


Loading…
Cancel
Save