2 * Copyright (c) 2019 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 __ONERT_KERNEL_CPU_DEPTHWISECONVOLUTIONLAYER_H__
18 #define __ONERT_KERNEL_CPU_DEPTHWISECONVOLUTIONLAYER_H__
20 #include <backend/IPortableTensor.h>
21 #include "OperationUtils.h"
22 #include "../ExternalContext.h"
24 #include <exec/IFunction.h>
35 class DepthwiseConvolutionLayer : public ::onert::exec::IFunction
38 DepthwiseConvolutionLayer() = default;
45 void configure(const IPortableTensor *input, const IPortableTensor *kernel,
46 const IPortableTensor *bias, const uint32_t paddingLeft,
47 const uint32_t paddingRight, const uint32_t paddingTop,
48 const uint32_t paddingBottom, const uint32_t strideW, const uint32_t strideH,
49 const uint32_t multiplier, const uint32_t dilationWidth,
50 const uint32_t dilationHeight, const ir::Activation activation,
51 IPortableTensor *output, const std::shared_ptr<ExternalContext> &external_context);
56 const IPortableTensor *_input{nullptr};
57 const IPortableTensor *_kernel{nullptr};
58 const IPortableTensor *_bias{nullptr};
59 IPortableTensor *_output{nullptr};
61 uint32_t _paddingLeft{0};
62 uint32_t _paddingTop{0};
63 uint32_t _paddingRight{0};
64 uint32_t _paddingBottom{0};
66 uint32_t _strideWidth{0};
67 uint32_t _strideHeight{0};
69 uint32_t _multiplier{0};
71 uint32_t _dilationWidth{1};
72 uint32_t _dilationHeight{1};
74 ir::Activation _activation{ir::Activation::NONE};
76 std::shared_ptr<ExternalContext> _external_context;
81 } // namespace backend
84 #endif // __ONERT_KERNEL_CPU_DEPTHWISECONVOLUTIONLAYER_H__