diff options
Diffstat (limited to 'tests/datasets_new')
-rw-r--r-- | tests/datasets_new/LargeConvolutionLayerDataset.h | 57 | ||||
-rw-r--r-- | tests/datasets_new/ShapeDatasets.h | 21 | ||||
-rw-r--r-- | tests/datasets_new/SmallConvolutionLayerDataset.h | 56 |
3 files changed, 131 insertions, 3 deletions
diff --git a/tests/datasets_new/LargeConvolutionLayerDataset.h b/tests/datasets_new/LargeConvolutionLayerDataset.h new file mode 100644 index 0000000000..6fef77009e --- /dev/null +++ b/tests/datasets_new/LargeConvolutionLayerDataset.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_LARGE_CONVOLUTION_LAYER_DATASET +#define ARM_COMPUTE_TEST_LARGE_CONVOLUTION_LAYER_DATASET + +#include "tests/datasets_new/ConvolutionLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class LargeConvolutionLayerDataset final : public ConvolutionLayerDataset +{ +public: + LargeConvolutionLayerDataset() + { + add_config(TensorShape(227U, 227U, 3U), TensorShape(11U, 11U, 3U, 96U), TensorShape(96U), TensorShape(55U, 55U, 96U), PadStrideInfo(4, 4, 0, 0)); + add_config(TensorShape(27U, 27U, 96U), TensorShape(5U, 5U, 96U, 256U), TensorShape(256U), TensorShape(27U, 27U, 256U), PadStrideInfo(1, 1, 2, 2)); + add_config(TensorShape(13U, 13U, 256U), TensorShape(3U, 3U, 256U, 384U), TensorShape(384U), TensorShape(13U, 13U, 384U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(13U, 13U, 384U), TensorShape(3U, 3U, 384U, 384U), TensorShape(384U), TensorShape(13U, 13U, 384U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(13U, 13U, 384U), TensorShape(3U, 3U, 384U, 256U), TensorShape(256U), TensorShape(13U, 13U, 256U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(224U, 224U, 3U), TensorShape(7U, 7U, 3U, 64U), TensorShape(64U), TensorShape(112U, 112U, 64U), PadStrideInfo(2, 2, 3, 3)); + add_config(TensorShape(28U, 28U, 256U), TensorShape(1U, 1U, 256U, 64U), TensorShape(64U), TensorShape(28U, 28U, 64U), PadStrideInfo(1, 1, 0, 0)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_LARGE_CONVOLUTION_LAYER_DATASET */ diff --git a/tests/datasets_new/ShapeDatasets.h b/tests/datasets_new/ShapeDatasets.h index ba142cae0c..14f7851621 100644 --- a/tests/datasets_new/ShapeDatasets.h +++ b/tests/datasets_new/ShapeDatasets.h @@ -35,7 +35,7 @@ namespace test { namespace datasets { -/** Data set containing one 1D tensor shape. */ +/** Data set containing 1D tensor shapes. */ class Small1DShape final : public framework::dataset::SingletonDataset<TensorShape> { public: @@ -48,7 +48,7 @@ public: /** Parent type for all for shape datasets. */ using ShapeDataset = framework::dataset::ContainerDataset<std::vector<TensorShape>>; -/** Data set containing two small 2D tensor shapes. */ +/** Data set containing small 2D tensor shapes. */ class Small2DShapes final : public ShapeDataset { public: @@ -93,7 +93,7 @@ public: } }; -/** Data set containing two 2D large tensor shapes. */ +/** Data set containing large 2D tensor shapes. */ class Large2DShapes final : public ShapeDataset { public: @@ -107,6 +107,21 @@ public: { } }; + +/** Data set containing small tensor shapes for direct convolution. */ +class SmallDirectConvolutionShapes final : public ShapeDataset +{ +public: + SmallDirectConvolutionShapes() + : ShapeDataset("InputShape", + { + TensorShape{ 3U, 3U, 3U, 2U, 4U, 5U }, + TensorShape{ 32U, 37U, 3U }, + TensorShape{ 13U, 15U, 8U, 3U } + }) + { + } +}; } // namespace datasets } // namespace test } // namespace arm_compute diff --git a/tests/datasets_new/SmallConvolutionLayerDataset.h b/tests/datasets_new/SmallConvolutionLayerDataset.h new file mode 100644 index 0000000000..2cd8da0b27 --- /dev/null +++ b/tests/datasets_new/SmallConvolutionLayerDataset.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_SMALL_CONVOLUTION_LAYER_DATASET +#define ARM_COMPUTE_TEST_SMALL_CONVOLUTION_LAYER_DATASET + +#include "tests/datasets_new/ConvolutionLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class SmallConvolutionLayerDataset final : public ConvolutionLayerDataset +{ +public: + SmallConvolutionLayerDataset() + { + add_config(TensorShape(23U, 27U, 5U), TensorShape(3U, 3U, 5U, 21U), TensorShape(21U), TensorShape(11U, 25U, 21U), PadStrideInfo(2, 1, 0, 0)); + add_config(TensorShape(33U, 27U, 7U), TensorShape(5U, 5U, 7U, 16U), TensorShape(16U), TensorShape(11U, 12U, 16U), PadStrideInfo(3, 2, 1, 0)); + add_config(TensorShape(17U, 31U, 2U, 7U), TensorShape(5U, 5U, 2U, 19U), TensorShape(19U), TensorShape(15U, 15U, 19U, 7U), PadStrideInfo(1, 2, 1, 1)); + add_config(TensorShape(23U, 27U, 5U), TensorShape(3U, 1U, 5U, 21U), TensorShape(21U), TensorShape(11U, 27U, 21U), PadStrideInfo(2, 1, 0, 0)); + add_config(TensorShape(33U, 27U, 7U), TensorShape(5U, 7U, 7U, 16U), TensorShape(16U), TensorShape(11U, 11U, 16U), PadStrideInfo(3, 2, 1, 0)); + add_config(TensorShape(17U, 31U, 2U, 7U), TensorShape(5U, 3U, 2U, 19U), TensorShape(19U), TensorShape(15U, 16U, 19U, 7U), PadStrideInfo(1, 2, 1, 1)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_SMALL_CONVOLUTION_LAYER_DATASET */ |