1 /** 2 * Copyright 2020 Huawei Technologies Co., Ltd 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef MINDSPORE_CCSRC_PIPELINE_JIT_PIPELINE_GE_H_ 18 #define MINDSPORE_CCSRC_PIPELINE_JIT_PIPELINE_GE_H_ 19 20 #include <vector> 21 #include <utility> 22 #include <string> 23 #include <memory> 24 #include <unordered_map> 25 #include <map> 26 #include <mutex> 27 28 #include "pybind11/pybind11.h" 29 #include "pipeline/jit/base.h" 30 #include "frontend/operator/ops.h" 31 32 namespace mindspore { 33 namespace pipeline { 34 namespace py = pybind11; 35 36 void SetGeOption(const std::map<std::string, std::string> &options); 37 38 void RunGEInitGraph(const py::dict &init_params, const std::string &phase); 39 40 py::object ExecDFGraph(const std::map<std::string, ExecutorInfoPtr> &info, const py::tuple &args, 41 const std::string &phase = "train"); 42 43 FuncGraphPtr BuildDFGraph(const std::map<std::string, ExecutorInfoPtr> &info, const py::dict &init_params, 44 const std::string &phase, const py::object &broadcast_params = {}); 45 46 // init and exec dataset sub graph for GE backend 47 bool InitExecDatasetGe(const std::string &queue_name, int64_t size, int64_t batch_size, 48 const std::vector<TypePtr> &types, const std::vector<std::vector<int64_t>> &shapes, 49 const std::vector<int64_t> &input_indexes, const std::string &phase); 50 51 void ExportDFGraph(const std::string &file_name, const std::string &phase); 52 } // namespace pipeline 53 } // namespace mindspore 54 55 #endif // MINDSPORE_CCSRC_PIPELINE_JIT_PIPELINE_GE_H_ 56