2 * Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __LUCI_IR_CIRCLEDEPTHWISECONV2D_H__
18 #define __LUCI_IR_CIRCLEDEPTHWISECONV2D_H__
20 #include "luci/IR/CircleNodeDecl.h"
21 #include "luci/IR/CircleOpcode.h"
23 #include "luci/IR/AttrDilation.h"
24 #include "luci/IR/AttrFilter.h"
25 #include "luci/IR/AttrPadding.h"
26 #include "luci/IR/AttrStride.h"
27 #include "luci/IR/AttrFusedActFunc.h"
28 #include "luci/IR/LuciNodeMixins.h"
34 * @brief DEPTHWISE_CONV_2D in Circle
36 class CircleDepthwiseConv2D final
37 : public FixedArityNode<3, CircleNodeImpl<CircleOpcode::DEPTHWISE_CONV_2D>>,
38 public LuciNodeMixin<LuciNodeTrait::FusedActFunc>,
39 public LuciNodeMixin<LuciNodeTrait::Bias>
42 loco::Node *input(void) const { return at(0)->node(); }
43 void input(loco::Node *node) { at(0)->node(node); }
45 loco::Node *filter(void) const { return at(1)->node(); }
46 void filter(loco::Node *node) { at(1)->node(node); }
48 loco::Node *bias(void) const override { return at(2)->node(); }
49 void bias(loco::Node *node) override { at(2)->node(node); }
52 Padding padding() const { return _padding; }
53 void padding(Padding padding) { _padding = padding; }
55 const Stride *stride(void) const { return &_stride; }
56 Stride *stride(void) { return &_stride; }
58 int32_t depthMultiplier(void) const { return _depth_multiplier; }
59 void depthMultiplier(int32_t arg) { _depth_multiplier = arg; }
61 const Dilation *dilation(void) const { return &_dilation; }
62 Dilation *dilation(void) { return &_dilation; }
65 Padding _padding = Padding::UNDEFINED;
67 int32_t _depth_multiplier = 0;
73 #endif // __LUCI_IR_CIRCLEDEPTHWISECONV2D_H__