27 #include "tests/datasets/ConvertPolicyDataset.h" 28 #include "tests/datasets/ShapeDatasets.h" 31 #include "tests/validation/fixtures/PixelWiseMultiplicationFixture.h" 43 const float scale_255 = 1.f / 255.f;
44 constexpr AbsoluteTolerance<float> tolerance_qasymm8(1);
45 constexpr AbsoluteTolerance<float> tolerance_qsymm16(1);
47 { ActivationLayerInfo() });
60 #define VALIDATE(TYPE, TOLERANCE) validate(CLAccessor(_target), _reference, AbsoluteTolerance<TYPE>(TOLERANCE), 0.f); 62 #define PIXEL_WISE_MULTIPLICATION_FIXTURE_DATA_TEST_CASE(TEST_NAME, FIXTURE, MODE, SHAPES, DT1, DT2, SCALE, RP, ACT, VALIDATE) \ 63 FIXTURE_DATA_TEST_CASE(TEST_NAME, CLPixelWiseMultiplication##FIXTURE, framework::DatasetMode::MODE, \ 64 combine(combine(combine(combine(combine(combine(combine( \ 66 framework::dataset::make("DataType1", DataType::DT1)), \ 67 framework::dataset::make("DataType2", DataType::DT2)), \ 68 framework::dataset::make("Scale", std::move(SCALE))), \ 69 datasets::ConvertPolicies()), \ 70 framework::dataset::make("RoundingPolicy", RoundingPolicy::RP)), ACT), \ 127 PIXEL_WISE_MULTIPLICATION_FIXTURE_DATA_TEST_CASE(RunWithActivation, ToF16Fixture<half_float::half>, ALL, TinyShapes(), F16, F16, scale_255, TO_NEAREST_UP, ActivationFunctionsDataset,
VALIDATE(
float,
134 PIXEL_WISE_MULTIPLICATION_FIXTURE_DATA_TEST_CASE(RunSmall, ToF32Fixture<
float>, PRECOMMIT, SmallShapes(), F32, F32, scale_255, TO_NEAREST_UP, EmptyActivationFunctionsDataset,
VALIDATE(
float, 1.f))
135 PIXEL_WISE_MULTIPLICATION_FIXTURE_DATA_TEST_CASE(RunWithActivation, ToF32Fixture<
float>, ALL, TinyShapes(), F32, F32, scale_255, TO_NEAREST_UP, ActivationFunctionsDataset,
VALIDATE(
float, 1.f))
144 template <typename T>
152 framework::dataset::
make("DataTypeIn1",
DataType::QASYMM8)),
153 framework::dataset::
make("DataTypeIn2",
DataType::QASYMM8)),
154 framework::dataset::
make("DataTypeOut",
DataType::QASYMM8)),
155 framework::dataset::
make("Scale", { 1.f, 2.f })),
171 framework::dataset::
make("DataTypeIn1",
DataType::QASYMM8_SIGNED)),
172 framework::dataset::
make("DataTypeIn2",
DataType::QASYMM8_SIGNED)),
173 framework::dataset::
make("DataTypeOut",
DataType::QASYMM8_SIGNED)),
174 framework::dataset::
make("Scale", { 1.f, 2.f })),
190 framework::dataset::
make("DataTypeIn1",
DataType::QSYMM16)),
191 framework::dataset::
make("DataTypeIn2",
DataType::QSYMM16)),
192 framework::dataset::
make("DataTypeOut",
DataType::QSYMM16)),
193 framework::dataset::
make("Scale", { 1.f, 2.f })),
PixelWiseMultiplicationValidationQuantizedFixture< CLTensor, CLAccessor, CLPixelWiseMultiplication, int16_t, int16_t, int32_t > CLPixelWiseMultiplicationQSYMM16ToS32Fxture
#define VALIDATE(TYPE, TOLERANCE)
quantized, symmetric fixed-point 16-bit number
Rounds to nearest value; half rounds away from zero.
1 channel, 1 U8 per channel
1 channel, 1 F32 per channel
ARM_COMPUTE_EXPECT(has_error==expected, framework::LogLevel::ERRORS)
std::enable_if< is_container< T >::value, ContainerDataset< T > >::type make(std::string name, T &&values)
Helper function to create a ContainerDataset.
Copyright (c) 2017-2021 Arm Limited.
PixelWiseMultiplicationValidationQuantizedFixture< CLTensor, CLAccessor, CLPixelWiseMultiplication, T, T > CLPixelWiseMultiplicationQuantizedFixture
1 channel, 1 F16 per channel
1 channel, 1 S32 per channel
Quantization information.
DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16), }), framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F16), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(30U, 11U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16, QuantizationInfo(1.f/32768.f, 0)), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16, QuantizationInfo(1.f/32768.f, 0)), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16, QuantizationInfo(1.f/32768.f, 0)), })), framework::dataset::make("ActivationInfo", { ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::TANH), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::TANH), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::SQRT), })), framework::dataset::make("Expected", { false, true, true, true, false, false, true, true, false })), input_info, output_info, act_info, expected)
DatasetMode
Possible dataset modes.
TEST_SUITE_END() FIXTURE_DATA_TEST_CASE(RunSmall
[CLActivationLayer Test snippet]
Accessor implementation for CLTensor objects.
#define PIXEL_WISE_MULTIPLICATION_FIXTURE_DATA_TEST_CASE(TEST_NAME, FIXTURE, MODE, SHAPES, DT1, DT2, SCALE, RP, ACT, VALIDATE)
PixelWiseMultiplicationBroadcastValidationFloatFixture< CLTensor, CLAccessor, CLPixelWiseMultiplication, T, float > CLPixelWiseMultiplicationBroadcastFixture
TEST_SUITE(U8_to_S8) FIXTURE_DATA_TEST_CASE(RunSmall
validate(CLAccessor(output_state), expected_output)
Basic function to run CLPixelWiseMultiplicationKernel.
1 channel, 1 S16 per channel
FIXTURE_DATA_TEST_CASE(RunSmall, CLAbsLayerFixture< half >, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F16)))
PixelWiseMultiplicationValidationFloatFixture< CLTensor, CLAccessor, CLPixelWiseMultiplication, T, half_float::half > CLPixelWiseMultiplicationToF16Fixture
Rounds to nearest value; half rounds to nearest even.
Upper Bounded Rectifier ( )
Store the tensor's metadata.
PixelWiseMultiplicationValidationFloatFixture< CLTensor, CLAccessor, CLPixelWiseMultiplication, T, float > CLPixelWiseMultiplicationToF32Fixture
quantized, asymmetric fixed-point 8-bit number signed
zip(zip(framework::dataset::make("Weights", { TensorInfo(TensorShape(32U, 13U, 2U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U, 1U), 1, DataType::F32), }), framework::dataset::make("MVBGInfo",{ TensorInfo(TensorShape(2U), 1, DataType::F32), TensorInfo(TensorShape(2U), 1, DataType::F16), TensorInfo(TensorShape(5U), 1, DataType::F32), })), framework::dataset::make("Expected", { true, false, false}))
DataType
Available data types.
Truncates the least significant values that are lost in operations.
combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)))
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, float scale, ConvertPolicy overflow_policy, RoundingPolicy rounding_policy, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of CLPixelWiseMultiplicatio...
Basic implementation of the OpenCL tensor interface.