!24588 not set debug_info for top_graph's call_node
Merge pull request !24588 from huanghui/fix-return-node-debug-info
This commit is contained in:
commit
97a5d80bf7
|
@ -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<AnfNodePtr> 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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue