30 #include "tests/datasets/ActivationFunctionsDataset.h" 31 #include "tests/datasets/ShapeDatasets.h" 36 #include "tests/validation/fixtures/ActivationLayerFixture.h" 55 constexpr
float epsilon = 1e-6f;
60 return AbsoluteTolerance<float>(data_type ==
DataType::F16 ? 0.2f : epsilon);
62 return AbsoluteTolerance<float>(data_type ==
DataType::F16 ? 0.1f : epsilon);
66 return AbsoluteTolerance<float>(5.f);
70 return AbsoluteTolerance<float>(data_type ==
DataType::F16 ? 0.001f : epsilon);
73 return AbsoluteTolerance<float>(data_type ==
DataType::F16 ? 0.00001f : epsilon);
78 return AbsoluteTolerance<float>(5.f);
82 return AbsoluteTolerance<float>(data_type ==
DataType::F16 ? 0.01f : 0.00001f);
87 return AbsoluteTolerance<float>(5.f);
91 return AbsoluteTolerance<float>(data_type ==
DataType::F16 ? 0.001f : 0.00001f);
94 return AbsoluteTolerance<float>(epsilon);
145 validate(dst.info()->valid_region(), valid_region);
155 validate(dst.info()->padding(), padding);
192 framework::dataset::make(
"Expected", {
false,
false,
true,
true,
false,
false,
false,
true,
true })),
200 template <
typename T>
237 template <
typename T>
247 framework::dataset::
make("FractionalBits", 3, 6)))
267 framework::dataset::
make("FractionalBits", 1, 14)))
283 template <
typename T>
quantized, symmetric fixed-point 16-bit number
quantized, symmetric fixed-point 8-bit number
bool is_resizable() const override
Flag indicating whether the size of the tensor can be changed.
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const ActivationLayerInfo &act_info)
Static function to check if given info will lead to a valid configuration of CLActivationLayer.
Container for 2D border size.
ValidRegion valid_region() const override
Valid region of the tensor.
half_float::half half
16-bit floating point type
1 channel, 1 F32 per channel
const auto QuantizedActivationDataset
std::enable_if< is_container< T >::value, ContainerDataset< T > >::type make(std::string name, T &&values)
Helper function to create a ContainerDataset.
Basic function to run CLActivationLayerKernel.
PaddingSize padding() const override
Padding of tensor.
TensorInfo * info() const override
Interface to be implemented by the child class to return the tensor's metadata.
Activation Layer Information class.
This file contains all available output stages for GEMMLowp on OpenCL.
ActivationFunction
Available activation functions.
1 channel, 1 F16 per channel
#define TEST_SUITE(SUITE_NAME)
FIXTURE_DATA_TEST_CASE(RunSmall, CLAbsoluteDifferenceFixture< uint8_t >, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), AbsoluteDifferenceU8Dataset))
validate(dst.info() ->valid_region(), dst_valid_region)
DatasetMode
Possible dataset modes.
ActivationValidationQuantizedFixture< CLTensor, CLAccessor, CLActivationLayer, T > CLActivationLayerQuantizedFixture
ActivationValidationFixture< CLTensor, CLAccessor, CLActivationLayer, T > CLActivationLayerFixture
quantized, asymmetric fixed-point 8-bit number
bool is_data_type_fixed_point(DataType dt)
Check if a given data type is of fixed point type.
Accessor implementation for CLTensor objects.
const auto QuantizedActivationFunctionsDataset
Input data sets.
size_t data_size_from_type(DataType data_type)
The size in bytes of the data type.
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)
void configure(ICLTensor *input, ICLTensor *output, ActivationLayerInfo act_info)
Set the input and output tensor.
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.
JoinDataset< T, U > concat(T &&dataset1, U &&dataset2)
Helper function to create a JoinDataset.
Quantization settings (used for QASYMM8 data type)
Container for valid region of a window.
DataType
Available data types.
ActivationValidationFixedPointFixture< CLTensor, CLAccessor, CLActivationLayer, T > CLActivationLayerFixedPointFixture
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.
Calculate required padding.
Basic implementation of the OpenCL tensor interface.