Compute Library
 22.11
QuantizationLayer.cpp File Reference
#include "arm_compute/core/Types.h"
#include "arm_compute/runtime/NEON/functions/NEQuantizationLayer.h"
#include "arm_compute/runtime/Tensor.h"
#include "arm_compute/runtime/TensorAllocator.h"
#include "tests/NEON/Accessor.h"
#include "tests/PaddingCalculator.h"
#include "tests/datasets/ShapeDatasets.h"
#include "tests/framework/Asserts.h"
#include "tests/framework/Macros.h"
#include "tests/framework/datasets/Datasets.h"
#include "tests/validation/Validation.h"
#include "tests/validation/fixtures/QuantizationLayerFixture.h"

Go to the source code of this file.

Namespaces

 arm_compute
 Copyright (c) 2017-2022 Arm Limited.
 
 arm_compute::test
 
 arm_compute::test::validation
 

Typedefs

template<typename T >
using NEQuantizationLayerQASYMM8Fixture = QuantizationValidationFixture< Tensor, Accessor, NEQuantizationLayer, T, uint8_t >
 
template<typename T >
using NEQuantizationLayerQASYMM8SignedFixture = QuantizationValidationFixture< Tensor, Accessor, NEQuantizationLayer, T, int8_t >
 
template<typename T >
using NEQuantizationLayerQASYMM16Fixture = QuantizationValidationFixture< Tensor, Accessor, NEQuantizationLayer, T, uint16_t >
 
template<typename T >
using NEQuantizationLayerQASYMM8_SIGNEDGenFixture = QuantizationValidationGenericFixture< Tensor, Accessor, NEQuantizationLayer, T, int8_t >
 
template<typename T >
using NEQuantizationLayerQASYMM16GenFixture = QuantizationValidationGenericFixture< Tensor, Accessor, NEQuantizationLayer, T, uint16_t >
 

Functions

 DATA_TEST_CASE (Validate, framework::DatasetMode::ALL, zip(zip(framework::dataset::make("InputInfo", { TensorInfo(TensorShape(16U, 16U, 16U, 5U), 1, DataType::QASYMM8), TensorInfo(TensorShape(16U, 16U, 16U, 5U), 1, DataType::F32), TensorInfo(TensorShape(16U, 16U, 2U, 5U), 1, DataType::F32), TensorInfo(TensorShape(16U, 16U, 16U, 5U), 1, DataType::F32), }), framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(16U, 16U, 16U, 5U), 1, DataType::F32), TensorInfo(TensorShape(16U, 16U, 16U, 5U), 1, DataType::U16), TensorInfo(TensorShape(16U, 16U, 16U, 5U), 1, DataType::QASYMM8), TensorInfo(TensorShape(16U, 16U, 16U, 5U), 1, DataType::QASYMM8), })), framework::dataset::make("Expected", { false, false, false, true})), input_info, output_info, expected)
 
 FIXTURE_DATA_TEST_CASE (RunSmallQASYMM8, NEQuantizationLayerQASYMM8Fixture< float >, framework::DatasetMode::PRECOMMIT, combine(combine(combine(QuantizationSmallShapes, framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("DataTypeOut", { DataType::QASYMM8 })), framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })))
 
 FIXTURE_DATA_TEST_CASE (RunSmallQASYMM8Signed, NEQuantizationLayerQASYMM8SignedFixture< float >, framework::DatasetMode::ALL, combine(combine(combine(QuantizationSmallShapes, framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("DataTypeOut", { DataType::QASYMM8_SIGNED })), framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })))
 
 FIXTURE_DATA_TEST_CASE (RunSmallQASYMM16, NEQuantizationLayerQASYMM16Fixture< float >, framework::DatasetMode::PRECOMMIT, combine(combine(combine(QuantizationSmallShapes, framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("DataTypeOut", { DataType::QASYMM16 })), framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })))
 
 FIXTURE_DATA_TEST_CASE (RunLargeQASYMM8, NEQuantizationLayerQASYMM8Fixture< float >, framework::DatasetMode::NIGHTLY, combine(combine(combine(QuantizationLargeShapes, framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("DataTypeOut", { DataType::QASYMM8 })), framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })))
 
 FIXTURE_DATA_TEST_CASE (RunLargeQASYMM16, NEQuantizationLayerQASYMM16Fixture< float >, framework::DatasetMode::NIGHTLY, combine(combine(combine(QuantizationLargeShapes, framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("DataTypeOut", { DataType::QASYMM16 })), framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })))
 
 TEST_SUITE_END () FIXTURE_DATA_TEST_CASE(RunSmall = ActivationValidationQuantizedFixture<CLTensor, CLAccessor, CLActivationLayer, T>
 [CLActivationLayer Test snippet] More...
 
 FIXTURE_DATA_TEST_CASE (RunSmallQASYMM8, NEQuantizationLayerQASYMM8GenFixture< uint8_t >, framework::DatasetMode::ALL, combine(combine(combine(combine(QuantizationSmallShapes, framework::dataset::make("DataType", DataType::QASYMM8)), framework::dataset::make("DataTypeOut", { DataType::QASYMM8 })), framework::dataset::make("QuantizationInfoOutput", { QuantizationInfo(0.5f, 10) })), framework::dataset::make("QuantizationInfoInput", { QuantizationInfo(2.0f, 15) })))
 
 FIXTURE_DATA_TEST_CASE (RunSmallQASYMM8_SIGNED, NEQuantizationLayerQASYMM8_SIGNEDGenFixture< uint8_t >, framework::DatasetMode::ALL, combine(combine(combine(combine(QuantizationSmallShapes, framework::dataset::make("DataTypeIn", DataType::QASYMM8)), framework::dataset::make("DataTypeOut", { DataType::QASYMM8_SIGNED })), framework::dataset::make("QuantizationInfoOutput", { QuantizationInfo(1.0f, 10), QuantizationInfo(2.0f, -25) })), framework::dataset::make("QuantizationInfoInput", { QuantizationInfo(1.0f, 15) })))
 
 FIXTURE_DATA_TEST_CASE (RunSmallQASYMM16, NEQuantizationLayerQASYMM16GenFixture< uint8_t >, framework::DatasetMode::ALL, combine(combine(combine(combine(QuantizationSmallShapes, framework::dataset::make("DataTypeIn", DataType::QASYMM8)), framework::dataset::make("DataTypeOut", { DataType::QASYMM16 })), framework::dataset::make("QuantizationInfoOutput", { QuantizationInfo(1.0f, 10) })), framework::dataset::make("QuantizationInfoInput", { QuantizationInfo(4.0f, 23) })))
 
 combine (combine(combine(combine(QuantizationSmallShapes, framework::dataset::make("DataTypeIn", DataType::QASYMM8_SIGNED)), framework::dataset::make("DataTypeOut", { DataType::QASYMM8_SIGNED })), framework::dataset::make("QuantizationInfoOutput", { QuantizationInfo(1.0f, 10) })), framework::dataset::make("QuantizationInfoInput", { QuantizationInfo(2.0f, -5) })))
 
 FIXTURE_DATA_TEST_CASE (RunSmallQASYMM8, NEQuantizationLayerQASYMM8GenFixture< int8_t >, framework::DatasetMode::ALL, combine(combine(combine(combine(QuantizationSmallShapes, framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), framework::dataset::make("DataTypeOut", { DataType::QASYMM8 })), framework::dataset::make("QuantizationInfoOutput", { QuantizationInfo(2.0f, 10), QuantizationInfo(2.0f, -25) })), framework::dataset::make("QuantizationInfoInput", { QuantizationInfo(1.0f, 30) })))
 

Variables

 NEQuantizationLayerQASYMM8_SIGNEDGenFixture< int8_t >