diff --git a/mindspore/ccsrc/pipeline/pipeline_ge.cc b/mindspore/ccsrc/pipeline/pipeline_ge.cc index 2f68935591..0b37e8f930 100644 --- a/mindspore/ccsrc/pipeline/pipeline_ge.cc +++ b/mindspore/ccsrc/pipeline/pipeline_ge.cc @@ -391,7 +391,12 @@ std::shared_ptr DoExecGraph(const FuncGraphPtr& graph, const std::ve const std::string& phase) { std::vector ge_tensors = TransformUtil::ConvertInputTensors(inputs, kOpFormat_NCHW); if (ge_tensors.size() != inputs.size()) { +<<<<<<< HEAD MS_LOG(EXCEPTION) << "Convert me args to ge tensor error."; +======= + MS_LOG(ERROR) << "args convert to ge tensor error"; + return nullptr; +>>>>>>> remove ge depend in cpu } std::vector ge_outputs; @@ -402,7 +407,12 @@ std::shared_ptr DoExecGraph(const FuncGraphPtr& graph, const std::ve auto graph_runner = DfGraphManager::GetInstance().GetGraphRunner(); if (graph_runner == nullptr) { +<<<<<<< HEAD MS_LOG(EXCEPTION) << "Can not found GraphRunner."; +======= + MS_LOG(ERROR) << "Can not found GraphRunner"; + return nullptr; +>>>>>>> remove ge depend in cpu } { @@ -419,7 +429,11 @@ std::shared_ptr DoExecGraph(const FuncGraphPtr& graph, const std::ve std::vector me_outputs = TransformUtil::ConvertGeTensors(ge_outputs); if (me_outputs.size() != ge_outputs.size()) { +<<<<<<< HEAD MS_LOG(WARNING) << "Convert output Ge tensor to Me tensor failed"; +======= + MS_LOG(ERROR) << "Convert output Ge tensor to Me tensor failed"; +>>>>>>> remove ge depend in cpu } py::tuple outputs(me_outputs.size()); @@ -429,11 +443,28 @@ std::shared_ptr DoExecGraph(const FuncGraphPtr& graph, const std::ve std::shared_ptr ret = nullptr; +<<<<<<< HEAD AnfNodePtr output_node = graph->get_return()->input(1); MS_EXCEPTION_IF_NULL(output_node); size_t count = 0; py::object oj = StructureOutput(output_node, outputs, &count); ret = std::make_shared(oj); +======= +#ifdef ENABLE_GE + AnfNodePtr root = graph->get_return(); + MS_EXCEPTION_IF_NULL(root); + AbstractBasePtr output = root->abstract(); + size_t count = 0; + py::object oj = StructureOutput(output, outputs, &count); + ret = std::make_shared(oj); +#else + if (outputs.size() == 1) { + ret = std::make_shared(outputs[0]); + } else { + ret = std::make_shared(outputs); + } +#endif +>>>>>>> remove ge depend in cpu return ret; } @@ -444,7 +475,11 @@ void ProcessGeArg(const std::map& info, const py:: std::size_t size = args.size(); if (info.count(phase) == 0) { +<<<<<<< HEAD MS_LOG(EXCEPTION) << "No phase in executor:" << GetPhasePrefix(phase); +======= + MS_LOG(EXCEPTION) << "no phase in executor:" << GetPhasePrefix(phase); +>>>>>>> remove ge depend in cpu } auto arg_size = info.at(phase)->arg_list_size; @@ -459,12 +494,20 @@ void ProcessGeArg(const std::map& info, const py:: ValuePtr converted = nullptr; bool succ = parse::ConvertData(args[i], &converted); if (!succ) { +<<<<<<< HEAD MS_LOG(EXCEPTION) << "Args convert error"; +======= + MS_LOG(EXCEPTION) << "args convert error"; +>>>>>>> remove ge depend in cpu } if (converted->isa()) { (*inputs).push_back(converted->cast()); } else { +<<<<<<< HEAD MS_LOG(EXCEPTION) << "Args " << converted->ToString() << " is not tensor"; +======= + MS_LOG(EXCEPTION) << "args, " << converted->ToString() << " is not tensor"; +>>>>>>> remove ge depend in cpu } } } @@ -481,12 +524,20 @@ py::object ExecDFGraph(const std::map& info, const } if (info.count(phase) == 0) { +<<<<<<< HEAD MS_LOG(EXCEPTION) << "There is no phase:" << phase; +======= + MS_LOG(EXCEPTION) << "has no phase:" << phase; +>>>>>>> remove ge depend in cpu } FuncGraphPtr anf_graph = info.at(phase)->func_graph; +<<<<<<< HEAD #ifdef ENABLE_INFER +======= +#if (!defined ENABLE_GE) || (defined ENABLE_INFER) +>>>>>>> remove ge depend in cpu // Now don't use the graph because the exec ge function don't take effect MS_EXCEPTION_IF_NULL(info.at(phase)->func_graph); if (ENABLE_TRAIN != info.at(phase)->func_graph->flags()["training"]) { @@ -511,7 +562,11 @@ py::object ExecDFGraph(const std::map& info, const if (ret != nullptr) { return *ret; } else { +<<<<<<< HEAD MS_LOG(EXCEPTION) << "Exec graph failed"; +======= + MS_LOG(EXCEPTION) << "exec graph failed"; +>>>>>>> remove ge depend in cpu } } void ExportDFGraph(const std::string& file_name, const std::string& phase) { diff --git a/mindspore/ccsrc/utils/callbacks.h b/mindspore/ccsrc/utils/callbacks.h index a1e4e75d5b..6f099ef4ca 100644 --- a/mindspore/ccsrc/utils/callbacks.h +++ b/mindspore/ccsrc/utils/callbacks.h @@ -40,7 +40,7 @@ const int kCallbackOk = 0; const int kCallbackFalied = 1; bool GetParameterShape(const FuncGraphPtr& anf_graph, const std::string& param_name, - const std::shared_ptr>& shape); + const std::shared_ptr>& shape) uint32_t SummarySaveCallback(uint32_t, const std::map&); } // namespace callbacks