Compute Library
 22.11
SoftmaxLayer.cpp File Reference
#include "arm_compute/core/Types.h"
#include "arm_compute/runtime/NEON/functions/NESoftmaxLayer.h"
#include "arm_compute/runtime/Tensor.h"
#include "arm_compute/runtime/TensorAllocator.h"
#include "src/common/cpuinfo/CpuIsaInfo.h"
#include "src/cpu/kernels/CpuSoftmaxKernel.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/SoftmaxLayerFixture.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 NESoftmaxLayerFixture = SoftmaxValidationFixture< Tensor, Accessor, NESoftmaxLayer, T >
 

Functions

 DATA_TEST_CASE (Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U), 1, DataType::F32), TensorInfo(TensorShape(27U, 13U), 1, DataType::F32), TensorInfo(TensorShape(27U, 13U), 1, DataType::QASYMM8, QuantizationInfo(1.f/256, 12)), TensorInfo(TensorShape(32U, 13U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U), 1, DataType::QASYMM8, QuantizationInfo(1.f/256, 12)), TensorInfo(TensorShape(32U, 13U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U), 1, DataType::QASYMM8, QuantizationInfo(1.f/256, 12)), TensorInfo(TensorShape(32U, 13U), 1, DataType::QASYMM8, QuantizationInfo(1.f/256, 12)), }), framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(27U, 13U), 1, DataType::F16), TensorInfo(TensorShape(27U, 11U), 1, DataType::F32), TensorInfo(TensorShape(27U, 13U), 1, DataType::QASYMM8, QuantizationInfo(1.f/256, 12)), TensorInfo(TensorShape(32U, 13U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U), 1, DataType::QASYMM8, QuantizationInfo(1.f/256, 0)), TensorInfo(TensorShape(32U, 13U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U), 1, DataType::QASYMM8, QuantizationInfo(1.f/256, 0)), TensorInfo(TensorShape(32U, 13U), 1, DataType::QASYMM8, QuantizationInfo(1.f/256, 0)), })), framework::dataset::make("beta", { 1.0, 2.0, 1.0, 2.0, 1.0, 1.0, 2.0, 1.0, })), framework::dataset::make("axis", { 0, 0, 0, 1, 0, -1, 2, -3, })), framework::dataset::make("Expected", { false, false, false, true, true, true, false, false })), input_info, output_info, beta, axis, expected)
 
 DATA_TEST_CASE (KernelSelection_max_logits, framework::DatasetMode::ALL, concat(combine(framework::dataset::make("CpuExt", std::string("NEON")), framework::dataset::make("DataType", { DataType::F32, DataType::F16, DataType::QASYMM8, DataType::QASYMM8_SIGNED })), combine(framework::dataset::make("CpuExt", std::string("SVE")), framework::dataset::make("DataType", { DataType::F32, DataType::F16, DataType::QASYMM8, DataType::QASYMM8_SIGNED }))), cpu_ext, data_type)
 
 DATA_TEST_CASE (KernelSelection_logits, framework::DatasetMode::ALL, concat(concat(combine(framework::dataset::make("CpuExt", std::string("NEON")), framework::dataset::make("DataType", { DataType::F32, DataType::F16, DataType::QASYMM8, DataType::QASYMM8_SIGNED })), combine(framework::dataset::make("CpuExt", std::string("SVE")), framework::dataset::make("DataType", { DataType::F32, DataType::F16 }))), combine(framework::dataset::make("CpuExt", std::string("SVE2")), framework::dataset::make("DataType", { DataType::QASYMM8, DataType::QASYMM8_SIGNED }))), cpu_ext, data_type)
 
 FIXTURE_DATA_TEST_CASE (RunSmall2D, NESoftmaxLayerFixture< float >, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SoftmaxLayerSmallShapes(), framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("Beta", { 1.0f, 2.0f })), framework::dataset::make("Axis", { 0, -1 })))
 
 FIXTURE_DATA_TEST_CASE (RunSmall4D, NESoftmaxLayerFixture< float >, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small4DShapes(), framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("Beta", { 1.0f, 2.0f })), framework::dataset::make("Axis", { 0, -2, 3 })))
 
 FIXTURE_DATA_TEST_CASE (RunLarge, NESoftmaxLayerFixture< float >, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::SoftmaxLayerLargeShapes(), framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("Beta", { 1.0f, 2.0f })), framework::dataset::make("Axis", { 0 })))
 
 TEST_SUITE_END () FIXTURE_DATA_TEST_CASE(RunSmall = ActivationValidationQuantizedFixture<CLTensor, CLAccessor, CLActivationLayer, T>
 [CLActivationLayer Test snippet] More...
 
 FIXTURE_DATA_TEST_CASE (RunSmall2D, NESoftmaxLayerQuantizedFixture< uint8_t >, framework::DatasetMode::ALL, combine(combine(combine(datasets::SoftmaxLayerSmallShapes(), framework::dataset::make("DataType", DataType::QASYMM8)), combine(framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, -10) }), framework::dataset::make("Beta", { 1.0f, 2.f }))), framework::dataset::make("Axis", { 0, -1 })))
 
 FIXTURE_DATA_TEST_CASE (RunSmall4D, NESoftmaxLayerQuantizedFixture< uint8_t >, framework::DatasetMode::ALL, combine(combine(combine(datasets::Small4DShapes(), framework::dataset::make("DataType", DataType::QASYMM8)), combine(framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, -10) }), framework::dataset::make("Beta", { 1.0f, 2.f }))), framework::dataset::make("Axis", { 0, 1, -2 })))
 
 FIXTURE_DATA_TEST_CASE (RunLarge, NESoftmaxLayerQuantizedFixture< uint8_t >, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::SoftmaxLayerLargeShapes(), framework::dataset::make("DataType", DataType::QASYMM8)), combine(framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, -10) }), framework::dataset::make("Beta", { 1.0f, 2.0f }))), framework::dataset::make("Axis", { 0 })))
 
 combine (combine(combine(datasets::SoftmaxLayerSmallShapes(), framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), combine(framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, -10) }), framework::dataset::make("Beta", { 1.0f, 2.f }))), framework::dataset::make("Axis", { 0, -1 })))
 
 FIXTURE_DATA_TEST_CASE (RunSmall4D, NESoftmaxLayerQuantizedFixture< int8_t >, framework::DatasetMode::ALL, combine(combine(combine(datasets::Small4DShapes(), framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), combine(framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, -10) }), framework::dataset::make("Beta", { 1.0f, 2.f }))), framework::dataset::make("Axis", { 0, 1, -1 })))
 

Variables

 NESoftmaxLayerQuantizedFixture< int8_t >