• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 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 LITE_MINDSPORE_LITE_TOOLS_CONVERTER_OPS_OPS_DEF_H_
18 #define LITE_MINDSPORE_LITE_TOOLS_CONVERTER_OPS_OPS_DEF_H_
19 #include "schema/inner/model_generated.h"
20 #include "ops/primitive_c.h"
21 using mindspore::ops::PrimitiveC;
22 
23 namespace mindspore {
24 namespace lite {
25 #define ADD_CONVERTER_ONLY_OP(name)      \
26   constexpr auto kName##name = #name;    \
27   class name : public PrimitiveC {       \
28    public:                               \
29     name() : PrimitiveC(kName##name) {}  \
30     ~name() = default;                   \
31     MS_DECLARE_PARENT(name, PrimitiveC); \
32   };
33 
34 ADD_CONVERTER_ONLY_OP(Enter);
35 ADD_CONVERTER_ONLY_OP(Exit);
36 ADD_CONVERTER_ONLY_OP(If);
37 ADD_CONVERTER_ONLY_OP(LoopCond);
38 ADD_CONVERTER_ONLY_OP(NextIteration);
39 ADD_CONVERTER_ONLY_OP(TensorArrayGatherV3);
40 ADD_CONVERTER_ONLY_OP(TensorArrayReadV3);
41 ADD_CONVERTER_ONLY_OP(TensorArrayScatterV3);
42 ADD_CONVERTER_ONLY_OP(TensorArraySizeV3);
43 ADD_CONVERTER_ONLY_OP(TensorArrayV3);
44 ADD_CONVERTER_ONLY_OP(TensorArrayWriteV3);
45 ADD_CONVERTER_ONLY_OP(Constant);
46 ADD_CONVERTER_ONLY_OP(MakeTuple);
47 ADD_CONVERTER_ONLY_OP(TupleGetItem);
48 ADD_CONVERTER_ONLY_OP(Return);
49 }  // namespace lite
50 }  // namespace mindspore
51 
52 #endif  // LITE_MINDSPORE_LITE_C_OPS_NEXTITERATION_H_
53