30 #include "tests/datasets/ConvertPolicyDataset.h" 31 #include "tests/datasets/ShapeDatasets.h" 36 #include "tests/validation/fixtures/ElementwiseOperationsFixture.h" 47 RelativeTolerance<float> tolerance_fp16(0.001f);
109 library->fill_tensor_uniform(ref_src1, 0);
110 library->fill_tensor_uniform(ref_src2, 1);
118 fn.
configure(&src1, &src2, use_nullptr_output ?
nullptr : &src1);
120 src1.allocator()->allocate();
133 auto src1 = create_tensor<CLTensor>(tensor_info);
134 auto src2 = create_tensor<CLTensor>(tensor_info);
143 auto src1 = create_tensor<CLTensor>(tensor_info);
144 auto src2 = create_tensor<CLTensor>(tensor_info);
150 template <
typename T>
151 using CLPReluLayerFixture = PReluLayerValidationFixture<CLTensor, CLAccessor, CLPReluLayer, T>;
161 template <
typename T>
167 PReluLayerQASYMM8Dataset),
181 PReluLayerQASYMM8SIGNEDDataset),
222 template <
typename T>
226 PReluLayerFP32Dataset))
Basic function to run opencl::kernels::ClArithmeticKernel for PRELU.
void compute_float_target_in_place(CLTensor &src1, CLTensor &src2, bool use_nullptr_output)
1 channel, 1 U8 per channel
half_float::half half
16-bit floating point type
1 channel, 1 F32 per channel
ARM_COMPUTE_EXPECT(has_error==expected, framework::LogLevel::ERRORS)
CLTensorAllocator * allocator()
Return a pointer to the tensor's allocator.
std::enable_if< is_container< T >::value, ContainerDataset< T > >::type make(std::string name, T &&values)
Helper function to create a ContainerDataset.
RelativeTolerance< float > tolerance_fp32(0.001f)
PReluLayerBroadcastValidationFixture< CLTensor, CLAccessor, CLPReluLayer, T > CLPReluLayerBroadcastFixture
Copyright (c) 2017-2022 Arm Limited.
1 channel, 1 F16 per channel
DataType data_type() const override
Data type used for each element of the tensor.
void configure(ICLTensor *input, ICLTensor *alpha, ICLTensor *output)
Set the input and output tensor.
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.
std::unique_ptr< AssetsLibrary > library
TEST_SUITE_END() FIXTURE_DATA_TEST_CASE(RunSmall
[CLActivationLayer Test snippet]
quantized, asymmetric fixed-point 8-bit number unsigned
Accessor implementation for CLTensor objects.
static Status validate(const ITensorInfo *input, const ITensorInfo *alpha, const ITensorInfo *output)
Static function to check if given info will lead to a valid configuration of CLPReluLayer.
validate(CLAccessor(output_state), expected_output)
PReluLayerValidationQuantizedFixture< CLTensor, CLAccessor, CLPReluLayer, T > CLPReluLayerQuantizedFixture
y*x if x < 0, x otherwise
1 channel, 1 S16 per channel
SimpleTensor< float > compute_float_reference(const TensorInfo &tensor_info)
FIXTURE_DATA_TEST_CASE(RunSmall, CLAbsLayerFixture< half >, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F16)))
void allocate() override
Allocate size specified by TensorInfo of OpenCL memory.
Simple tensor object that stores elements in a consecutive chunk of memory.
Store the tensor's metadata.
TEST_CASE(FusedActivation, framework::DatasetMode::ALL)
Validate fused activation expecting the following behaviours:
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}))
const TensorShape & tensor_shape() const override
Size for each dimension of the tensor.
TEST_SUITE(QASYMM8_to_F32) FIXTURE_DATA_TEST_CASE(RunSmall
combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)))
Basic implementation of the OpenCL tensor interface.