xref: /aosp_15_r20/external/ComputeLibrary/tests/datasets/DepthwiseConvolutionLayerDataset.h (revision c217d954acce2dbc11938adb493fc0abd69584f3)
1*c217d954SCole Faust /*
2*c217d954SCole Faust  * Copyright (c) 2017-2021 Arm Limited.
3*c217d954SCole Faust  *
4*c217d954SCole Faust  * SPDX-License-Identifier: MIT
5*c217d954SCole Faust  *
6*c217d954SCole Faust  * Permission is hereby granted, free of charge, to any person obtaining a copy
7*c217d954SCole Faust  * of this software and associated documentation files (the "Software"), to
8*c217d954SCole Faust  * deal in the Software without restriction, including without limitation the
9*c217d954SCole Faust  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10*c217d954SCole Faust  * sell copies of the Software, and to permit persons to whom the Software is
11*c217d954SCole Faust  * furnished to do so, subject to the following conditions:
12*c217d954SCole Faust  *
13*c217d954SCole Faust  * The above copyright notice and this permission notice shall be included in all
14*c217d954SCole Faust  * copies or substantial portions of the Software.
15*c217d954SCole Faust  *
16*c217d954SCole Faust  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17*c217d954SCole Faust  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18*c217d954SCole Faust  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19*c217d954SCole Faust  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20*c217d954SCole Faust  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21*c217d954SCole Faust  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22*c217d954SCole Faust  * SOFTWARE.
23*c217d954SCole Faust  */
24*c217d954SCole Faust #ifndef ARM_COMPUTE_TEST_DEPTHWISE_CONVOLUTION_DATASET
25*c217d954SCole Faust #define ARM_COMPUTE_TEST_DEPTHWISE_CONVOLUTION_DATASET
26*c217d954SCole Faust 
27*c217d954SCole Faust #include "utils/TypePrinter.h"
28*c217d954SCole Faust 
29*c217d954SCole Faust #include "arm_compute/core/TensorShape.h"
30*c217d954SCole Faust #include "arm_compute/core/Types.h"
31*c217d954SCole Faust 
32*c217d954SCole Faust namespace arm_compute
33*c217d954SCole Faust {
34*c217d954SCole Faust namespace test
35*c217d954SCole Faust {
36*c217d954SCole Faust namespace datasets
37*c217d954SCole Faust {
38*c217d954SCole Faust class DepthwiseConvolutionLayerDataset
39*c217d954SCole Faust {
40*c217d954SCole Faust public:
41*c217d954SCole Faust     using type = std::tuple<TensorShape, Size2D, PadStrideInfo, Size2D>;
42*c217d954SCole Faust 
43*c217d954SCole Faust     struct iterator
44*c217d954SCole Faust     {
iteratoriterator45*c217d954SCole Faust         iterator(std::vector<TensorShape>::const_iterator   src_it,
46*c217d954SCole Faust                  std::vector<Size2D>::const_iterator        weights_it,
47*c217d954SCole Faust                  std::vector<PadStrideInfo>::const_iterator infos_it,
48*c217d954SCole Faust                  std::vector<Size2D>::const_iterator        dilation_it)
49*c217d954SCole Faust             : _src_it{ std::move(src_it) },
50*c217d954SCole Faust               _weights_it{ std::move(weights_it) },
51*c217d954SCole Faust               _infos_it{ std::move(infos_it) },
52*c217d954SCole Faust               _dilation_it{ std::move(dilation_it) }
53*c217d954SCole Faust         {
54*c217d954SCole Faust         }
55*c217d954SCole Faust 
descriptioniterator56*c217d954SCole Faust         std::string description() const
57*c217d954SCole Faust         {
58*c217d954SCole Faust             std::stringstream description;
59*c217d954SCole Faust             description << "In=" << *_src_it << ":";
60*c217d954SCole Faust             description << "Weights=" << *_weights_it << ":";
61*c217d954SCole Faust             description << "Info=" << *_infos_it << ":";
62*c217d954SCole Faust             description << "Dilation=" << *_dilation_it;
63*c217d954SCole Faust             return description.str();
64*c217d954SCole Faust         }
65*c217d954SCole Faust 
66*c217d954SCole Faust         DepthwiseConvolutionLayerDataset::type operator*() const
67*c217d954SCole Faust         {
68*c217d954SCole Faust             return std::make_tuple(*_src_it, *_weights_it, *_infos_it, *_dilation_it);
69*c217d954SCole Faust         }
70*c217d954SCole Faust 
71*c217d954SCole Faust         iterator &operator++()
72*c217d954SCole Faust         {
73*c217d954SCole Faust             ++_src_it;
74*c217d954SCole Faust             ++_weights_it;
75*c217d954SCole Faust             ++_infos_it;
76*c217d954SCole Faust             ++_dilation_it;
77*c217d954SCole Faust 
78*c217d954SCole Faust             return *this;
79*c217d954SCole Faust         }
80*c217d954SCole Faust 
81*c217d954SCole Faust     private:
82*c217d954SCole Faust         std::vector<TensorShape>::const_iterator   _src_it;
83*c217d954SCole Faust         std::vector<Size2D>::const_iterator        _weights_it;
84*c217d954SCole Faust         std::vector<PadStrideInfo>::const_iterator _infos_it;
85*c217d954SCole Faust         std::vector<Size2D>::const_iterator        _dilation_it;
86*c217d954SCole Faust     };
87*c217d954SCole Faust 
begin()88*c217d954SCole Faust     iterator begin() const
89*c217d954SCole Faust     {
90*c217d954SCole Faust         return iterator(_src_shapes.begin(), _weight_shapes.begin(), _infos.begin(), _dilations.begin());
91*c217d954SCole Faust     }
92*c217d954SCole Faust 
size()93*c217d954SCole Faust     int size() const
94*c217d954SCole Faust     {
95*c217d954SCole Faust         return std::min(_src_shapes.size(), std::min(_weight_shapes.size(), std::min(_infos.size(), _dilations.size())));
96*c217d954SCole Faust     }
97*c217d954SCole Faust 
98*c217d954SCole Faust     void add_config(TensorShape src, Size2D weights, PadStrideInfo info, Size2D dilation = Size2D(1U, 1U))
99*c217d954SCole Faust     {
100*c217d954SCole Faust         _src_shapes.emplace_back(std::move(src));
101*c217d954SCole Faust         _weight_shapes.emplace_back(std::move(weights));
102*c217d954SCole Faust         _infos.emplace_back(std::move(info));
103*c217d954SCole Faust         _dilations.emplace_back(std::move(dilation));
104*c217d954SCole Faust     }
105*c217d954SCole Faust 
106*c217d954SCole Faust protected:
107*c217d954SCole Faust     DepthwiseConvolutionLayerDataset()                                    = default;
108*c217d954SCole Faust     DepthwiseConvolutionLayerDataset(DepthwiseConvolutionLayerDataset &&) = default;
109*c217d954SCole Faust 
110*c217d954SCole Faust private:
111*c217d954SCole Faust     std::vector<TensorShape>   _src_shapes{};
112*c217d954SCole Faust     std::vector<Size2D>        _weight_shapes{};
113*c217d954SCole Faust     std::vector<PadStrideInfo> _infos{};
114*c217d954SCole Faust     std::vector<Size2D>        _dilations{};
115*c217d954SCole Faust };
116*c217d954SCole Faust 
117*c217d954SCole Faust /** Dataset containing small, generic depthwise convolution shapes. */
118*c217d954SCole Faust class SmallDepthwiseConvolutionLayerDataset final : public DepthwiseConvolutionLayerDataset
119*c217d954SCole Faust {
120*c217d954SCole Faust public:
SmallDepthwiseConvolutionLayerDataset()121*c217d954SCole Faust     SmallDepthwiseConvolutionLayerDataset()
122*c217d954SCole Faust     {
123*c217d954SCole Faust         add_config(TensorShape(7U, 7U, 1U), Size2D(1U, 1U), PadStrideInfo(1, 1, 0, 0));
124*c217d954SCole Faust         add_config(TensorShape(3U, 3U, 2U), Size2D(2U, 2U), PadStrideInfo(1, 1, 0, 0));
125*c217d954SCole Faust         add_config(TensorShape(33U, 27U, 7U), Size2D(7U, 3U), PadStrideInfo(3, 2, 1, 0));
126*c217d954SCole Faust         // Asymmetric padding
127*c217d954SCole Faust         add_config(TensorShape(33U, 27U, 7U), Size2D(5U, 7U), PadStrideInfo(3, 2, 1, 1, 2, 0, DimensionRoundingType::FLOOR));
128*c217d954SCole Faust         add_config(TensorShape(33U, 27U, 7U), Size2D(5U, 7U), PadStrideInfo(3, 2, 1, 1, 0, 2, DimensionRoundingType::FLOOR));
129*c217d954SCole Faust         // Ceil rounding
130*c217d954SCole Faust         add_config(TensorShape(7U, 8U, 5U, 9U), Size2D(8U, 6U), PadStrideInfo(2, 3, 1, 1, 1, 3, DimensionRoundingType::CEIL), Size2D(1U, 2U));
131*c217d954SCole Faust     }
132*c217d954SCole Faust };
133*c217d954SCole Faust 
134*c217d954SCole Faust /** Dataset containing large, generic depthwise convolution shapes. */
135*c217d954SCole Faust class LargeDepthwiseConvolutionLayerDataset final : public DepthwiseConvolutionLayerDataset
136*c217d954SCole Faust {
137*c217d954SCole Faust public:
LargeDepthwiseConvolutionLayerDataset()138*c217d954SCole Faust     LargeDepthwiseConvolutionLayerDataset()
139*c217d954SCole Faust     {
140*c217d954SCole Faust         add_config(TensorShape(33U, 27U, 11U), Size2D(3U, 4U), PadStrideInfo(1, 2, 0, 1));
141*c217d954SCole Faust         add_config(TensorShape(17U, 31U, 2U), Size2D(5U, 9U), PadStrideInfo(1, 2, 1, 1));
142*c217d954SCole Faust         add_config(TensorShape(23U, 27U, 5U), Size2D(11U, 3U), PadStrideInfo(1, 2, 0, 0));
143*c217d954SCole Faust         add_config(TensorShape(17U, 31U, 2U, 3U), Size2D(5U, 9U), PadStrideInfo(1, 2, 1, 1));
144*c217d954SCole Faust         add_config(TensorShape(233U, 277U, 55U), Size2D(1U, 1U), PadStrideInfo(2, 1, 0, 0));
145*c217d954SCole Faust         add_config(TensorShape(333U, 277U, 77U), Size2D(1U, 1U), PadStrideInfo(3, 2, 1, 0));
146*c217d954SCole Faust         add_config(TensorShape(177U, 311U, 22U), Size2D(3U, 4U), PadStrideInfo(1, 2, 1, 1));
147*c217d954SCole Faust         add_config(TensorShape(233U, 277U, 55U), Size2D(3U, 4U), PadStrideInfo(1, 2, 0, 0));
148*c217d954SCole Faust         add_config(TensorShape(333U, 277U, 77U), Size2D(3U, 4U), PadStrideInfo(2, 3, 0, 1));
149*c217d954SCole Faust         add_config(TensorShape(177U, 311U, 22U), Size2D(3U, 4U), PadStrideInfo(2, 1, 1, 1));
150*c217d954SCole Faust         // Asymmetric padding
151*c217d954SCole Faust         add_config(TensorShape(33U, 27U, 7U), Size2D(5U, 7U), PadStrideInfo(3, 2, 2, 1, 2, 0, DimensionRoundingType::FLOOR));
152*c217d954SCole Faust         add_config(TensorShape(33U, 27U, 7U), Size2D(5U, 7U), PadStrideInfo(3, 2, 1, 3, 0, 2, DimensionRoundingType::FLOOR));
153*c217d954SCole Faust         add_config(TensorShape(33U, 27U, 7U), Size2D(5U, 7U), PadStrideInfo(3, 2, 1, 0, 1, 0, DimensionRoundingType::FLOOR));
154*c217d954SCole Faust         add_config(TensorShape(33U, 27U, 7U), Size2D(5U, 7U), PadStrideInfo(3, 2, 0, 1, 0, 1, DimensionRoundingType::FLOOR));
155*c217d954SCole Faust     }
156*c217d954SCole Faust };
157*c217d954SCole Faust 
158*c217d954SCole Faust /** Dataset containing large kernel size for generic depthwise convolution. */
159*c217d954SCole Faust class LargeKernelSizeDepthwiseConvolutionLayerNHWCDataset final : public DepthwiseConvolutionLayerDataset
160*c217d954SCole Faust {
161*c217d954SCole Faust public:
LargeKernelSizeDepthwiseConvolutionLayerNHWCDataset()162*c217d954SCole Faust     LargeKernelSizeDepthwiseConvolutionLayerNHWCDataset()
163*c217d954SCole Faust     {
164*c217d954SCole Faust         add_config(TensorShape(6U, 210U, 8U), Size2D(4U, 194U), PadStrideInfo(1, 1, 0, 0));
165*c217d954SCole Faust     }
166*c217d954SCole Faust };
167*c217d954SCole Faust 
168*c217d954SCole Faust /** Dataset containing small, 3x3 depthwise convolution shapes. */
169*c217d954SCole Faust class SmallDepthwiseConvolutionLayerDataset3x3 final : public DepthwiseConvolutionLayerDataset
170*c217d954SCole Faust {
171*c217d954SCole Faust public:
SmallDepthwiseConvolutionLayerDataset3x3()172*c217d954SCole Faust     SmallDepthwiseConvolutionLayerDataset3x3()
173*c217d954SCole Faust     {
174*c217d954SCole Faust         add_config(TensorShape(1U, 1U, 2U), Size2D(3U, 3U), PadStrideInfo(1, 1, 2, 2));
175*c217d954SCole Faust         add_config(TensorShape(7U, 8U, 3U, 2U), Size2D(3U, 3U), PadStrideInfo(1, 1, 0, 0));
176*c217d954SCole Faust         add_config(TensorShape(32U, 31U, 9U, 4U), Size2D(3U, 3U), PadStrideInfo(1, 1, 0, 0));
177*c217d954SCole Faust         // Asymmetric padding
178*c217d954SCole Faust         add_config(TensorShape(33U, 27U, 11U), Size2D(3U, 3U), PadStrideInfo(2, 2, 0, 1, 0, 1, DimensionRoundingType::FLOOR));
179*c217d954SCole Faust     }
180*c217d954SCole Faust };
181*c217d954SCole Faust 
182*c217d954SCole Faust class SmallDepthwiseConvolutionLayerDataset3x3NCHW final : public DepthwiseConvolutionLayerDataset
183*c217d954SCole Faust {
184*c217d954SCole Faust public:
SmallDepthwiseConvolutionLayerDataset3x3NCHW()185*c217d954SCole Faust     SmallDepthwiseConvolutionLayerDataset3x3NCHW()
186*c217d954SCole Faust     {
187*c217d954SCole Faust         add_config(TensorShape(33U, 27U, 11U), Size2D(3U, 3U), PadStrideInfo(3, 2, 1, 1));
188*c217d954SCole Faust         // Asymmetric padding
189*c217d954SCole Faust         add_config(TensorShape(33U, 27U, 11U), Size2D(3U, 3U), PadStrideInfo(2, 2, 3, 1, 2, 1, DimensionRoundingType::FLOOR));
190*c217d954SCole Faust     }
191*c217d954SCole Faust };
192*c217d954SCole Faust 
193*c217d954SCole Faust /** Dataset containing large, 3x3 depthwise convolution shapes. */
194*c217d954SCole Faust class LargeDepthwiseConvolutionLayerDataset3x3 final : public DepthwiseConvolutionLayerDataset
195*c217d954SCole Faust {
196*c217d954SCole Faust public:
LargeDepthwiseConvolutionLayerDataset3x3()197*c217d954SCole Faust     LargeDepthwiseConvolutionLayerDataset3x3()
198*c217d954SCole Faust     {
199*c217d954SCole Faust         add_config(TensorShape(33U, 27U, 11U, 3U), Size2D(3U, 3U), PadStrideInfo(1, 1, 1, 1));
200*c217d954SCole Faust         add_config(TensorShape(21U, 31U, 9U, 4U), Size2D(3U, 3U), PadStrideInfo(1, 2, 1, 0));
201*c217d954SCole Faust         add_config(TensorShape(33U, 27U, 11U, 3U), Size2D(3U, 3U), PadStrideInfo(1, 2, 0, 1));
202*c217d954SCole Faust         add_config(TensorShape(33U, 27U, 11U, 3U), Size2D(3U, 3U), PadStrideInfo(1, 2, 1, 1));
203*c217d954SCole Faust         add_config(TensorShape(21U, 31U, 9U, 4U), Size2D(3U, 3U), PadStrideInfo(2, 1, 1, 0));
204*c217d954SCole Faust         add_config(TensorShape(33U, 27U, 11U, 3U), Size2D(3U, 3U), PadStrideInfo(2, 1, 0, 1));
205*c217d954SCole Faust         add_config(TensorShape(33U, 27U, 11U, 3U), Size2D(3U, 3U), PadStrideInfo(2, 1, 1, 1));
206*c217d954SCole Faust         add_config(TensorShape(21U, 31U, 9U, 4U), Size2D(3U, 3U), PadStrideInfo(2, 2, 1, 0));
207*c217d954SCole Faust         add_config(TensorShape(33U, 27U, 11U, 3U), Size2D(3U, 3U), PadStrideInfo(2, 2, 0, 1));
208*c217d954SCole Faust         add_config(TensorShape(33U, 27U, 11U, 3U), Size2D(3U, 3U), PadStrideInfo(2, 2, 1, 1));
209*c217d954SCole Faust         add_config(TensorShape(177U, 311U, 22U), Size2D(3U, 3U), PadStrideInfo(1, 2, 1, 1));
210*c217d954SCole Faust         add_config(TensorShape(233U, 277U, 55U), Size2D(3U, 3U), PadStrideInfo(1, 2, 0, 0));
211*c217d954SCole Faust         add_config(TensorShape(333U, 277U, 77U), Size2D(3U, 3U), PadStrideInfo(2, 3, 0, 0));
212*c217d954SCole Faust         add_config(TensorShape(177U, 311U, 22U), Size2D(3U, 3U), PadStrideInfo(2, 1, 1, 1));
213*c217d954SCole Faust         // Width and height are a multipile of the processing tile size
214*c217d954SCole Faust         add_config(TensorShape(32U, 21U, 11U, 3U), Size2D(3U, 3U), PadStrideInfo(1, 1, 0, 1));
215*c217d954SCole Faust     }
216*c217d954SCole Faust };
217*c217d954SCole Faust 
218*c217d954SCole Faust /** Dataset containing optimized, 3x3 depthwise convolution shapes. */
219*c217d954SCole Faust class SmallOptimizedDepthwiseConvolutionLayerDataset3x3 final : public DepthwiseConvolutionLayerDataset
220*c217d954SCole Faust {
221*c217d954SCole Faust public:
SmallOptimizedDepthwiseConvolutionLayerDataset3x3()222*c217d954SCole Faust     SmallOptimizedDepthwiseConvolutionLayerDataset3x3()
223*c217d954SCole Faust     {
224*c217d954SCole Faust         // Stride 1
225*c217d954SCole Faust         add_config(TensorShape(7U, 7U, 16U), Size2D(3U, 3U), PadStrideInfo(1, 1, 0, 0, DimensionRoundingType::CEIL));
226*c217d954SCole Faust         add_config(TensorShape(7U, 7U, 16U), Size2D(3U, 3U), PadStrideInfo(1, 1, 0, 0, DimensionRoundingType::CEIL), Size2D(2U, 2U));
227*c217d954SCole Faust         add_config(TensorShape(7U, 7U, 16U), Size2D(3U, 3U), PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL));
228*c217d954SCole Faust         add_config(TensorShape(7U, 7U, 16U), Size2D(3U, 3U), PadStrideInfo(1, 1, 2, 2, DimensionRoundingType::CEIL), Size2D(2U, 2U));
229*c217d954SCole Faust         // Stride 2
230*c217d954SCole Faust         add_config(TensorShape(9U, 9U, 32U), Size2D(3U, 3U), PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL));
231*c217d954SCole Faust         add_config(TensorShape(9U, 9U, 32U), Size2D(3U, 3U), PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL), Size2D(2U, 2U));
232*c217d954SCole Faust         add_config(TensorShape(9U, 9U, 32U), Size2D(3U, 3U), PadStrideInfo(2, 2, 1, 1, DimensionRoundingType::CEIL));
233*c217d954SCole Faust     }
234*c217d954SCole Faust };
235*c217d954SCole Faust /** Dataset containing optimized, 3x3 depthwise convolution shapes. */
236*c217d954SCole Faust class LargeOptimizedDepthwiseConvolutionLayerDataset3x3 final : public DepthwiseConvolutionLayerDataset
237*c217d954SCole Faust {
238*c217d954SCole Faust public:
LargeOptimizedDepthwiseConvolutionLayerDataset3x3()239*c217d954SCole Faust     LargeOptimizedDepthwiseConvolutionLayerDataset3x3()
240*c217d954SCole Faust     {
241*c217d954SCole Faust         // Stride 1
242*c217d954SCole Faust         add_config(TensorShape(233U, 277U, 16U), Size2D(3U, 3U), PadStrideInfo(1, 1, 0, 0, DimensionRoundingType::CEIL));
243*c217d954SCole Faust         add_config(TensorShape(233U, 7U, 16U), Size2D(3U, 3U), PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL));
244*c217d954SCole Faust         add_config(TensorShape(7U, 7U, 21U), Size2D(3U, 3U), PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL));
245*c217d954SCole Faust         add_config(TensorShape(28U, 28U, 16U), Size2D(3U, 3U), PadStrideInfo(1, 1, 0, 0, DimensionRoundingType::CEIL));
246*c217d954SCole Faust         add_config(TensorShape(28U, 28U, 16U), Size2D(3U, 3U), PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL));
247*c217d954SCole Faust         // Stride 2
248*c217d954SCole Faust         add_config(TensorShape(233U, 277U, 32U), Size2D(3U, 3U), PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL));
249*c217d954SCole Faust         add_config(TensorShape(233U, 277U, 32U), Size2D(3U, 3U), PadStrideInfo(2, 2, 1, 1, 1, 1, DimensionRoundingType::CEIL));
250*c217d954SCole Faust         add_config(TensorShape(8U, 8U, 32U), Size2D(3U, 3U), PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::FLOOR));
251*c217d954SCole Faust         add_config(TensorShape(8U, 8U, 32U), Size2D(3U, 3U), PadStrideInfo(2, 2, 0, 1, 0, 1, DimensionRoundingType::CEIL));
252*c217d954SCole Faust         add_config(TensorShape(8U, 8U, 33U), Size2D(3U, 3U), PadStrideInfo(2, 2, 0, 1, 0, 1, DimensionRoundingType::CEIL));
253*c217d954SCole Faust         add_config(TensorShape(64U, 64U, 128U), Size2D(3U, 3U), PadStrideInfo(2, 2, 0, 1, 0, 1, DimensionRoundingType::CEIL));
254*c217d954SCole Faust     }
255*c217d954SCole Faust };
256*c217d954SCole Faust 
257*c217d954SCole Faust /** Dataset containing optimized, 5x5 depthwise convolution shapes. */
258*c217d954SCole Faust class SmallOptimizedDepthwiseConvolutionLayerDataset5x5 final : public DepthwiseConvolutionLayerDataset
259*c217d954SCole Faust {
260*c217d954SCole Faust public:
SmallOptimizedDepthwiseConvolutionLayerDataset5x5()261*c217d954SCole Faust     SmallOptimizedDepthwiseConvolutionLayerDataset5x5()
262*c217d954SCole Faust     {
263*c217d954SCole Faust         // Stride 1
264*c217d954SCole Faust         add_config(TensorShape(7U, 7U, 16U), Size2D(5U, 5U), PadStrideInfo(1, 1, 0, 0, DimensionRoundingType::CEIL));
265*c217d954SCole Faust         add_config(TensorShape(11U, 11U, 16U), Size2D(5U, 5U), PadStrideInfo(1, 1, 0, 0, DimensionRoundingType::CEIL), Size2D(2U, 2U));
266*c217d954SCole Faust         add_config(TensorShape(7U, 7U, 16U), Size2D(5U, 5U), PadStrideInfo(1, 1, 2, 2, DimensionRoundingType::CEIL));
267*c217d954SCole Faust         add_config(TensorShape(7U, 7U, 16U), Size2D(5U, 5U), PadStrideInfo(1, 1, 4, 4, DimensionRoundingType::CEIL), Size2D(2U, 2U));
268*c217d954SCole Faust         // Stride 2
269*c217d954SCole Faust         add_config(TensorShape(9U, 9U, 32U), Size2D(5U, 5U), PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL));
270*c217d954SCole Faust         add_config(TensorShape(9U, 9U, 32U), Size2D(5U, 5U), PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL), Size2D(2U, 2U));
271*c217d954SCole Faust         add_config(TensorShape(9U, 9U, 32U), Size2D(5U, 5U), PadStrideInfo(2, 2, 2, 2, 2, 2, DimensionRoundingType::CEIL));
272*c217d954SCole Faust         add_config(TensorShape(9U, 9U, 32U), Size2D(5U, 5U), PadStrideInfo(2, 2, 4, 4, 4, 4, DimensionRoundingType::CEIL), Size2D(2U, 2U));
273*c217d954SCole Faust     }
274*c217d954SCole Faust };
275*c217d954SCole Faust 
276*c217d954SCole Faust /** Dataset containing in-place 1x1 depthwise convolution shapes.
277*c217d954SCole Faust  *
278*c217d954SCole Faust  * For a depthwise convolution op to be in-place:
279*c217d954SCole Faust  * * Output has the same shape as the input;
280*c217d954SCole Faust  *      * 1x1 filter
281*c217d954SCole Faust  *      * stride == 1
282*c217d954SCole Faust  *      * dilations == 1
283*c217d954SCole Faust  *      * No paddings
284*c217d954SCole Faust */
285*c217d954SCole Faust class SmallInPlaceDepthwiseConvolutionLayerDataset final : public DepthwiseConvolutionLayerDataset
286*c217d954SCole Faust {
287*c217d954SCole Faust public:
SmallInPlaceDepthwiseConvolutionLayerDataset()288*c217d954SCole Faust     SmallInPlaceDepthwiseConvolutionLayerDataset()
289*c217d954SCole Faust     {
290*c217d954SCole Faust         add_config(TensorShape(7U, 7U, 1U), Size2D(1U, 1U), PadStrideInfo(1, 1, 0, 0));
291*c217d954SCole Faust         add_config(TensorShape(11U, 13U, 16U), Size2D(1U, 1U), PadStrideInfo(1, 1, 0, 0));
292*c217d954SCole Faust     }
293*c217d954SCole Faust };
294*c217d954SCole Faust } // namespace datasets
295*c217d954SCole Faust } // namespace test
296*c217d954SCole Faust } // namespace arm_compute
297*c217d954SCole Faust #endif /* ARM_COMPUTE_TEST_DEPTHWISE_CONVOLUTION_DATASET */