diff options
Diffstat (limited to 'tests/datasets')
-rw-r--r-- | tests/datasets/FullyConnectedLayerDataset.h | 15 | ||||
-rw-r--r-- | tests/datasets/ShapeDatasets.h | 81 | ||||
-rw-r--r-- | tests/datasets/TinyConvolutionLayerDataset.h | 57 | ||||
-rw-r--r-- | tests/datasets/TinyGEMMDataset.h | 52 |
4 files changed, 205 insertions, 0 deletions
diff --git a/tests/datasets/FullyConnectedLayerDataset.h b/tests/datasets/FullyConnectedLayerDataset.h index 60183f8746..085e9c76b6 100644 --- a/tests/datasets/FullyConnectedLayerDataset.h +++ b/tests/datasets/FullyConnectedLayerDataset.h @@ -114,6 +114,21 @@ private: std::vector<TensorShape> _dst_shapes{}; }; +class TinyFullyConnectedLayerDataset final : public FullyConnectedLayerDataset +{ +public: + TinyFullyConnectedLayerDataset() + { + // Conv -> FC + add_config(TensorShape(8U, 1U, 1U), TensorShape(8U, 16U), TensorShape(16U), TensorShape(16U)); + // Conv -> FC + add_config(TensorShape(1U, 1U, 1U, 3U), TensorShape(1U, 10U), TensorShape(10U), TensorShape(10U, 3U)); + // FC -> FC + add_config(TensorShape(1U), TensorShape(1U, 10U), TensorShape(10U), TensorShape(10U)); + // FC -> FC (batched) + add_config(TensorShape(1U, 3U), TensorShape(1U, 10U), TensorShape(10U), TensorShape(10U, 3U)); + } +}; class SmallFullyConnectedLayerDataset final : public FullyConnectedLayerDataset { public: diff --git a/tests/datasets/ShapeDatasets.h b/tests/datasets/ShapeDatasets.h index 79e052c697..dbcd9d5000 100644 --- a/tests/datasets/ShapeDatasets.h +++ b/tests/datasets/ShapeDatasets.h @@ -51,6 +51,19 @@ public: } }; +/** Data set containing tiny 2D tensor shapes. */ +class Tiny2DShapes final : public ShapeDataset +{ +public: + Tiny2DShapes() + : ShapeDataset("Shape", + { + TensorShape{ 7U, 7U }, + TensorShape{ 11U, 13U }, + }) + { + } +}; /** Data set containing small 2D tensor shapes. */ class Small2DShapes final : public ShapeDataset { @@ -66,6 +79,20 @@ public: } }; +/** Data set containing tiny 3D tensor shapes. */ +class Tiny3DShapes final : public ShapeDataset +{ +public: + Tiny3DShapes() + : ShapeDataset("Shape", + { + TensorShape{ 7U, 7U, 5U }, + TensorShape{ 23U, 13U, 9U }, + }) + { + } +}; + /** Data set containing small 3D tensor shapes. */ class Small3DShapes final : public ShapeDataset { @@ -81,6 +108,19 @@ public: } }; +/** Data set containing tiny 4D tensor shapes. */ +class Tiny4DShapes final : public ShapeDataset +{ +public: + Tiny4DShapes() + : ShapeDataset("Shape", + { + TensorShape{ 7U, 7U, 5U, 3U }, + TensorShape{ 17U, 13U, 7U, 2U }, + }) + { + } +}; /** Data set containing small 4D tensor shapes. */ class Small4DShapes final : public ShapeDataset { @@ -97,6 +137,20 @@ public: }; /** Data set containing small tensor shapes. */ +class TinyShapes final : public ShapeDataset +{ +public: + TinyShapes() + : ShapeDataset("Shape", + { + // Batch size 1 + TensorShape{ 9U, 9U }, + TensorShape{ 27U, 13U, 2U }, + }) + { + } +}; +/** Data set containing small tensor shapes. */ class SmallShapes final : public ShapeDataset { public: @@ -299,6 +353,20 @@ public: } }; +/** Data set containing tiny tensor shapes for direct convolution. */ +class TinyDirectConvolutionShapes final : public ShapeDataset +{ +public: + TinyDirectConvolutionShapes() + : ShapeDataset("InputShape", + { + // Batch size 1 + TensorShape{ 11U, 13U, 3U }, + TensorShape{ 7U, 27U, 3U } + }) + { + } +}; /** Data set containing small tensor shapes for direct convolution. */ class SmallDirectConvolutionShapes final : public ShapeDataset { @@ -352,6 +420,19 @@ public: { } }; +/** Data set containing tiny softmax layer shapes. */ +class SoftmaxLayerTinyShapes final : public ShapeDataset +{ +public: + SoftmaxLayerTinyShapes() + : ShapeDataset("Shape", + { + TensorShape{ 9U, 9U }, + TensorShape{ 128U, 10U, 2U }, + }) + { + } +}; /** Data set containing small softmax layer shapes. */ class SoftmaxLayerSmallShapes final : public ShapeDataset diff --git a/tests/datasets/TinyConvolutionLayerDataset.h b/tests/datasets/TinyConvolutionLayerDataset.h new file mode 100644 index 0000000000..178ebd33fa --- /dev/null +++ b/tests/datasets/TinyConvolutionLayerDataset.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2018 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_TINY_CONVOLUTION_LAYER_DATASET +#define ARM_COMPUTE_TEST_TINY_CONVOLUTION_LAYER_DATASET + +#include "tests/datasets/ConvolutionLayerDataset.h" + +#include "utils/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class TinyConvolutionLayerDataset final : public ConvolutionLayerDataset +{ +public: + TinyConvolutionLayerDataset() + { + // Batch size 1 + 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)); + // Batch size 4 + add_config(TensorShape(17U, 31U, 2U, 4U), TensorShape(5U, 5U, 2U, 19U), TensorShape(19U), TensorShape(15U, 15U, 19U, 4U), PadStrideInfo(1, 2, 1, 1)); + // FC convolution + add_config(TensorShape(1U, 1U, 1024U), TensorShape(1U, 1U, 1024U, 1001U), TensorShape(1001U), TensorShape(1U, 1U, 1001U), PadStrideInfo(1, 1, 0, 0)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_TINY_CONVOLUTION_LAYER_DATASET */ diff --git a/tests/datasets/TinyGEMMDataset.h b/tests/datasets/TinyGEMMDataset.h new file mode 100644 index 0000000000..83af8f0098 --- /dev/null +++ b/tests/datasets/TinyGEMMDataset.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2017-2018 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_TINY_GEMM_DATASET +#define ARM_COMPUTE_TEST_TINY_GEMM_DATASET + +#include "tests/datasets/GEMMDataset.h" + +#include "utils/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class TinyGEMMDataset final : public GEMMDataset +{ +public: + TinyGEMMDataset() + { + add_config(TensorShape(21U, 13U), TensorShape(33U, 21U), TensorShape(33U, 13U), TensorShape(33U, 13U), 1.0f, 0.0f); + add_config(TensorShape(31U, 1U), TensorShape(23U, 31U), TensorShape(23U, 1U), TensorShape(23U, 1U), 1.0f, 0.0f); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_TINY_GEMM_DATASET */ |