From 23b5d2a23cc8f0f2e4fe4a00ee42cd5bed7894c3 Mon Sep 17 00:00:00 2001 From: huanghui Date: Sat, 9 Oct 2021 11:24:07 +0800 Subject: [PATCH] not set debug_info for top_graph's call_node --- mindspore/ccsrc/pipeline/jit/parse/parse.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mindspore/ccsrc/pipeline/jit/parse/parse.cc b/mindspore/ccsrc/pipeline/jit/parse/parse.cc index 389a7a52b28..7cc3f4a6847 100644 --- a/mindspore/ccsrc/pipeline/jit/parse/parse.cc +++ b/mindspore/ccsrc/pipeline/jit/parse/parse.cc @@ -2185,17 +2185,21 @@ FuncGraphPtr MakeTopGraph(const py::object &cell, const ValuePtr &cell_ptr) { } auto unpacking = func_graph->has_vararg() || func_graph->has_kwarg(); - TraceGuard guard(current_graph->get_return()->debug_info()->location()); if (!unpacking) { std::vector inputs; inputs.emplace_back(NewValueNode(cell_ptr)); auto ¶ms = func_graph->parameters(); (void)std::transform(params.begin(), params.end(), std::back_inserter(inputs), [](AnfNodePtr node) -> AnfNodePtr { return node; }); - func_graph->set_output(func_graph->NewCNodeInOrder(std::move(inputs))); + auto call_node = func_graph->NewCNodeInOrder(std::move(inputs)); + + TraceGuard guard(current_graph->get_return()->debug_info()->location()); + func_graph->set_output(call_node); } else { // ret = cell_obj(*arg, *kwargs) auto call_fn = MakeUnpackCall(func_graph, NewValueNode(cell_ptr), func_graph->parameters()); + + TraceGuard guard(current_graph->get_return()->debug_info()->location()); // Set output as ret func_graph->set_output(call_fn); }