fc638d49fb7df8cbbee14f781ad039df8cb0f47a
[platform/core/ml/nnfw.git] / compiler / luci / lang / include / luci / IR / Nodes / CircleTransposeConv.h
1 /*
2  * Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
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 __LUCI_IR_CIRCLETRANSPOSECONV_H__
18 #define __LUCI_IR_CIRCLETRANSPOSECONV_H__
19
20 #include "luci/IR/CircleNodeDecl.h"
21 #include "luci/IR/CircleOpcode.h"
22
23 #include "luci/IR/AttrPadding.h"
24 #include "luci/IR/AttrStride.h"
25 #include "luci/IR/LuciNodeMixins.h"
26
27 namespace luci
28 {
29
30 /**
31  * @brief TRANSPOSE_CONV in Circle
32  *
33  * @note  Argument node function names are from TensorFlow. So referring 'in' and
34  *        'out' acutally means 'out' and 'in' of the this node.
35  */
36 class CircleTransposeConv final
37     : public FixedArityNode<3, CircleNodeImpl<CircleOpcode::TRANSPOSE_CONV>>
38 {
39 public:
40   loco::Node *inputSizes(void) const { return at(0)->node(); }
41   void inputSizes(Node *node) { at(0)->node(node); }
42
43   loco::Node *filter(void) const { return at(1)->node(); }
44   void filter(Node *node) { at(1)->node(node); }
45
46   loco::Node *outBackprop(void) const { return at(2)->node(); }
47   void outBackprop(Node *node) { at(2)->node(node); }
48
49 public:
50   const Padding &padding(void) const { return _padding; }
51   void padding(const Padding &padding) { _padding = padding; }
52
53   const Stride *stride(void) const { return &_stride; }
54   Stride *stride(void) { return &_stride; }
55
56 private:
57   Padding _padding{Padding::UNDEFINED};
58   Stride _stride;
59 };
60
61 } // namespace luci
62
63 #endif // __LUCI_IR_CIRCLETRANSPOSECONV_H__