ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Padding.h
Go to the documentation of this file.
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 __ONERT_IR_PADDIGN_H__
18#define __ONERT_IR_PADDIGN_H__
19
20#include "Shape.h"
21#include "InternalType.h"
22
23#include <cstdint>
24#include <string>
25
26namespace onert
27{
28namespace ir
29{
30
31enum class PaddingType
32{
33 EXPLICIT = 0,
34 SAME = 1,
35 VALID = 2
36};
37
43inline std::string to_string(const PaddingType type);
44
46{
47 uint32_t left;
48 uint32_t right;
49 uint32_t top;
50 uint32_t bottom;
51};
52
53// TODO Resolve explicit padding param at frontend and save in value field
54struct Padding
55{
56 Padding(void);
57 Padding(PaddingType paddingType);
58 Padding(uint32_t left, uint32_t right, uint32_t top, uint32_t bottom);
59
60 // TODO Change to private field
63};
64
65// TODO Change to Padding struct's method
66const ExplicitPadding calculatePadding(const Padding &padding, const FeatureShape &ifm_shape,
67 const FeatureShape &ofm_shape, const Stride &stride,
68 uint32_t kw, uint32_t kh, uint32_t dwf = 1,
69 uint32_t dhf = 1);
70
71} // namespace ir
72} // namespace onert
73
74#endif
const ExplicitPadding calculatePadding(const Padding &padding, const FeatureShape &ifm_shape, const FeatureShape &ofm_shape, const Stride &stride, uint32_t kw, uint32_t kh, uint32_t dwf=1, uint32_t dhf=1)
Definition Padding.cc:133
std::string to_string(Layout layout)
Definition Layout.h:43
Structure to have values of dimensions for feature.
Definition Shape.h:36
PaddingType type
Definition Padding.h:61
ExplicitPadding param
Definition Padding.h:62