30 #include "tests/datasets/RandomBatchNormalizationLayerDataset.h" 31 #include "tests/datasets/ShapeDatasets.h" 37 #include "tests/validation/fixtures/BatchNormalizationLayerFixture.h" 47 constexpr AbsoluteTolerance<float> tolerance_f32(0.00001f);
48 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 49 constexpr AbsoluteTolerance<float> tolerance_f16(0.01f);
51 constexpr AbsoluteTolerance<float> tolerance_qs8(3.0f);
52 constexpr AbsoluteTolerance<float> tolerance_qs16(6.0f);
71 shape0, shape1, epsilon, use_beta, use_gamma, dt, data_layout)
85 Tensor mean = create_tensor<Tensor>(shape1, dt, 1, fixed_point_position);
86 Tensor var = create_tensor<Tensor>(shape1, dt, 1, fixed_point_position);
87 Tensor beta = create_tensor<Tensor>(shape1, dt, 1, fixed_point_position);
88 Tensor gamma = create_tensor<Tensor>(shape1, dt, 1, fixed_point_position);
92 Tensor *beta_ptr = use_beta ? &beta :
nullptr;
93 Tensor *gamma_ptr = use_gamma ? &gamma :
nullptr;
94 norm.configure(&src, &dst, &mean, &var, beta_ptr, gamma_ptr, epsilon);
98 validate(dst.info()->valid_region(), valid_region);
148 framework::dataset::make(
"Expected", {
true,
false,
false,
false,
false,
false,
false,
false,
true,
true})),
151 const auto &mean_info = mvbg_info;
152 const auto &var_info = mvbg_info;
153 const auto &beta_info = mvbg_info;
154 const auto &gamma_info = mvbg_info;
156 &
input_info.clone()->set_is_resizable(
false), output_info.total_size() ? &output_info.clone()->set_is_resizable(
false) :
nullptr,
157 &mean_info.clone()->set_is_resizable(
false), &var_info.clone()->set_is_resizable(
false),
158 &beta_info.clone()->set_is_resizable(
false), &gamma_info.clone()->set_is_resizable(
false), 1.f, act_info));
167 combine(framework::dataset::
make("UseBeta", {
false,
true }),
178 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 195 template <
typename T>
201 framework::dataset::
make("UseBeta", false)),
202 framework::dataset::
make("UseGamma", false)),
206 framework::dataset::
make("FractionalBits", 1, 6)))
216 framework::dataset::
make("UseBeta", false)),
217 framework::dataset::
make("UseGamma", false)),
221 framework::dataset::
make("FractionalBits", 1, 14)))
quantized, symmetric fixed-point 16-bit number
quantized, symmetric fixed-point 8-bit number
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const ITensorInfo *mean, const ITensorInfo *var, const ITensorInfo *beta=nullptr, const ITensorInfo *gamma=nullptr, float epsilon=0.001f, ActivationLayerInfo act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of NEBatchNormalizationLaye...
BatchNormalizationLayerValidationFixedPointFixture< Tensor, Accessor, NEBatchNormalizationLayer, T > NEBatchNormalizationLayerFixedPointFixture
1 channel, 1 F32 per channel
Strides PermutationVector
Permutation vector.
std::enable_if< is_container< T >::value, ContainerDataset< T > >::type make(std::string name, T &&values)
Helper function to create a ContainerDataset.
Activation Layer Information class.
This file contains all available output stages for GEMMLowp on OpenCL.
1 channel, 1 F16 per channel
#define TEST_SUITE(SUITE_NAME)
void permute(Dimensions< T > &dimensions, const PermutationVector &perm)
Permutes given Dimensions according to a permutation vector.
FIXTURE_DATA_TEST_CASE(RunSmall, CLAbsoluteDifferenceFixture< uint8_t >, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), AbsoluteDifferenceU8Dataset))
validate(dst.info() ->valid_region(), dst_valid_region)
Accessor implementation for Tensor objects.
DatasetMode
Possible dataset modes.
bool is_data_type_fixed_point(DataType dt)
Check if a given data type is of fixed point type.
Basic function to run NENormalizationLayerKernel and simulate a batch normalization layer...
Basic implementation of the tensor interface.
Num samples, channels, height, width.
DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), AbsoluteDifferenceU8Dataset), shape, data_type0, data_type1, output_data_type)
Lower and Upper Bounded Rectifier ( )
Upper Bounded Rectifier ( )
TEST_SUITE_END() DATA_TEST_CASE(Configuration
ARM_COMPUTE_EXPECT(src.info() ->is_resizable(), framework::LogLevel::ERRORS)
Num samples, height, width, channels.
combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), framework::dataset::make("DataType",{DataType::U8, DataType::S16})), datasets::BorderModes()), framework::dataset::make("filter_size",{5}))
Store the tensor's metadata.
Quantization settings (used for QASYMM8 data type)
Container for valid region of a window.
DataType
Available data types.
DataLayout
Supported tensor data layouts.
BatchNormalizationLayerValidationFixture< Tensor, Accessor, NEBatchNormalizationLayer, T > NEBatchNormalizationLayerFixture
zip(zip(zip(framework::dataset::make("InputInfo",{TensorInfo(TensorShape(3U, 3U, 5U, 3U), 1, DataType::F16), TensorInfo(TensorShape(3U, 3U, 5U, 3U), 1, DataType::QASYMM8), TensorInfo(TensorShape(5U, 5U, 5U, 3U), 1, DataType::F32), TensorInfo(TensorShape(3U, 3U), 1, DataType::F32), TensorInfo(TensorShape(3U, 3U, 5U, 3U), 1, DataType::F32), TensorInfo(TensorShape(3U, 3U, 37U, 2U), 1, DataType::F32), TensorInfo(TensorShape(3U, 3U, 37U, 22U), 1, DataType::F32)}), framework::dataset::make("OutputInfo",{TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::F16), TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::QASYMM8), TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::F32), TensorInfo(TensorShape(1U, 1U, 16U), 1, DataType::F32), TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::F32), TensorInfo(TensorShape(2U, 37U, 16U), 1, DataType::F32), TensorInfo(TensorShape(22U, 37U, 36U), 1, DataType::F32)})), framework::dataset::make("WinogradInfo",{WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW), WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW), WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW), WinogradInfo(Size2D(3U, 3U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW), WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW), WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW), WinogradInfo(Size2D(4U, 4U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW)})), framework::dataset::make("Expected",{false, false, false, false, true, true, true}))
convolution configure & src
ValidRegion shape_to_valid_region(const TensorShape &a_shape, bool border_undefined=false, BorderSize border_size=BorderSize(0))
Create a valid region based on tensor shape, border mode and border size.