1 /** 2 * Copyright 2020-2021 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_FRONTEND_OPERATOR_COMPOSITE_UNPACK_CALL_H_ 18 #define MINDSPORE_CCSRC_FRONTEND_OPERATOR_COMPOSITE_UNPACK_CALL_H_ 19 20 #include <string> 21 #include <map> 22 #include <set> 23 #include <memory> 24 25 #include "utils/hash_map.h" 26 #include "pipeline/jit/ps/static_analysis/static_analysis.h" 27 #include "utils/misc.h" 28 #include "utils/any.h" 29 #include "ir/dtype.h" 30 #include "ir/meta_func_graph.h" 31 #include "utils/ms_utils.h" 32 33 namespace mindspore { 34 // namespace to support composite operators definition 35 namespace prim { 36 // Expand the tuple and dict parameters generated when parsing the function call, 37 // and generate positional parameters and key-value pairs for function. 38 class UnpackCall : public MetaFuncGraph { 39 public: UnpackCall(const std::string & name)40 explicit UnpackCall(const std::string &name) : MetaFuncGraph(name) {} 41 ~UnpackCall() override = default; 42 MS_DECLARE_PARENT(UnpackCall, MetaFuncGraph) 43 FuncGraphPtr GenerateFuncGraph(const AbstractBasePtrList &args_abs_list) override; 44 friend bool operator==(const UnpackCall &lhs, const UnpackCall &rhs) { return lhs.name_ == rhs.name_; } 45 }; 46 using UnpackCallPtr = std::shared_ptr<UnpackCall>; 47 } // namespace prim 48 } // namespace mindspore 49 50 #endif // MINDSPORE_CCSRC_FRONTEND_OPERATOR_COMPOSITE_UNPACK_CALL_H_ 51