1 /** 2 * Copyright 2019 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_LIST_APPEND_OPERATION_H_ 18 #define MINDSPORE_CCSRC_FRONTEND_OPERATOR_COMPOSITE_LIST_APPEND_OPERATION_H_ 19 20 #include <vector> 21 #include <string> 22 #include <memory> 23 24 #include "ir/meta_func_graph.h" 25 26 namespace mindspore { 27 // namespace to support composite operators definition 28 namespace prim { 29 class ListAppend : public MetaFuncGraph { 30 public: ListAppend(const std::string & name)31 explicit ListAppend(const std::string &name) : MetaFuncGraph(name) {} 32 ~ListAppend() override = default; 33 MS_DECLARE_PARENT(ListAppend, MetaFuncGraph) 34 FuncGraphPtr GenerateFuncGraph(const abstract::AbstractBasePtrList &a_list) override; 35 friend std::ostream &operator<<(std::ostream &os, const ListAppend &list_append) { 36 os << list_append.name_; 37 return os; 38 } 39 friend bool operator==(const ListAppend &lhs, const ListAppend &rhs) { return lhs.name_ == rhs.name_; } 40 }; 41 using ListAppendPtr = std::shared_ptr<ListAppend>; 42 } // namespace prim 43 } // namespace mindspore 44 45 #endif // MINDSPORE_CCSRC_FRONTEND_OPERATOR_COMPOSITE_LIST_APPEND_OPERATION_H_ 46