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