Compute Library
 22.05
QLSTMLayerNormalization.cpp File Reference
#include "arm_compute/core/Types.h"
#include "arm_compute/runtime/Tensor.h"
#include "arm_compute/runtime/TensorAllocator.h"
#include "src/core/NEON/kernels/NEQLSTMLayerNormalizationKernel.h"
#include "tests/NEON/Accessor.h"
#include "tests/NEON/Helper.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/Helpers.h"
#include "tests/validation/Validation.h"
#include "tests/validation/fixtures/QLSTMLayerNormalizationFixture.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
 

Macros

#define QSYMM16_DATASET_ITER(num_input_batch, num_iter)
 
#define QSYMM16_DATASET_1D   concat(concat(QSYMM16_DATASET_ITER(1, 0), QSYMM16_DATASET_ITER(1, 1)), QSYMM16_DATASET_ITER(1, 2))
 
#define QSYMM16_DATASET_2D   concat(concat(QSYMM16_DATASET_ITER(3, 0), QSYMM16_DATASET_ITER(3, 1)), QSYMM16_DATASET_ITER(3, 2))
 

Typedefs

template<typename T >
using NEQLSTMLayerNormalizationFixture = QLSTMLayerNormalizationValidationFixture< Tensor, Accessor, NEQLSTMLayerNormalization, T >
 

Functions

 DATA_TEST_CASE (Validate, framework::DatasetMode::ALL, zip(zip(zip(framework::dataset::make("InputInfo", { TensorInfo(correct_input_shape, tensor_num_channel, DataType::F16), TensorInfo(correct_input_shape, tensor_num_channel, correct_input_dt), TensorInfo(correct_input_shape, tensor_num_channel, correct_input_dt), TensorInfo(TensorShape(15U, 2U, 2U), tensor_num_channel, correct_input_dt), TensorInfo(correct_input_shape, tensor_num_channel, correct_input_dt), TensorInfo(correct_input_shape, tensor_num_channel, correct_input_dt), TensorInfo(correct_input_shape, tensor_num_channel, correct_input_dt), TensorInfo(correct_input_shape, tensor_num_channel, correct_input_dt), TensorInfo(correct_input_shape, tensor_num_channel, correct_input_dt), TensorInfo(correct_input_shape, tensor_num_channel, correct_input_dt), }), framework::dataset::make("WeightInfo", { TensorInfo(correct_weight_shape, tensor_num_channel, correct_weight_dt), TensorInfo(correct_weight_shape, tensor_num_channel, DataType::F16), TensorInfo(correct_weight_shape, tensor_num_channel, correct_weight_dt), TensorInfo(correct_weight_shape, tensor_num_channel, correct_weight_dt), TensorInfo(TensorShape(15U, 2U), tensor_num_channel, correct_weight_dt), TensorInfo(correct_weight_shape, tensor_num_channel, correct_weight_dt), TensorInfo(TensorShape(14U), tensor_num_channel, correct_weight_dt), TensorInfo(correct_weight_shape, tensor_num_channel, correct_weight_dt), TensorInfo(correct_weight_shape, tensor_num_channel, correct_weight_dt), TensorInfo(correct_weight_shape, tensor_num_channel, correct_weight_dt), })), framework::dataset::make("BiasInfo", { TensorInfo(correct_bias_shape, tensor_num_channel, correct_bias_dt), TensorInfo(correct_bias_shape, tensor_num_channel, correct_bias_dt), TensorInfo(correct_bias_shape, tensor_num_channel, DataType::QSYMM16), TensorInfo(correct_bias_shape, tensor_num_channel, correct_bias_dt), TensorInfo(correct_bias_shape, tensor_num_channel, correct_bias_dt), TensorInfo(TensorShape(15U, 2U), tensor_num_channel, correct_bias_dt), TensorInfo(correct_bias_shape, tensor_num_channel, correct_bias_dt), TensorInfo(TensorShape(14U), tensor_num_channel, correct_bias_dt), TensorInfo(correct_bias_shape, tensor_num_channel, correct_bias_dt), TensorInfo(correct_bias_shape, tensor_num_channel, correct_bias_dt), })), framework::dataset::make("OutputInfo", { TensorInfo(correct_output_shape, tensor_num_channel, correct_output_dt), TensorInfo(correct_output_shape, tensor_num_channel, correct_output_dt), TensorInfo(correct_output_shape, tensor_num_channel, correct_output_dt), TensorInfo(correct_output_shape, tensor_num_channel, correct_output_dt), TensorInfo(correct_output_shape, tensor_num_channel, correct_output_dt), TensorInfo(correct_output_shape, tensor_num_channel, correct_output_dt), TensorInfo(correct_output_shape, tensor_num_channel, correct_output_dt), TensorInfo(correct_output_shape, tensor_num_channel, correct_output_dt), TensorInfo(TensorShape(15, 3), tensor_num_channel, correct_output_dt), TensorInfo(correct_output_shape, tensor_num_channel, DataType::S32), })), input_info, weight_info, bias_info, output_info)
 
 FIXTURE_DATA_TEST_CASE (RandomValue1D, NEQLSTMLayerNormalizationFixture< int16_t >, framework::DatasetMode::ALL, concat(concat(combine(combine(zip(zip(QLSTMLayerNormShapeDataSet< qsymm16_per_vector, 1, 0 >("InputShape"), QLSTMLayerNormShapeDataSet< qsymm16_per_vector, 1, 0 >("WeightShape")), QLSTMLayerNormShapeDataSet< qsymm16_per_vector, 1, 0 >("BiasShape")), framework::dataset::make("DataType", DataType::QSYMM16)), framework::dataset::make("WeightQuantizationInfo", { QuantizationInfo(1./8192), QuantizationInfo(8192) })), combine(combine(zip(zip(QLSTMLayerNormShapeDataSet< qsymm16_per_vector, 1, 1 >("InputShape"), QLSTMLayerNormShapeDataSet< qsymm16_per_vector, 1, 1 >("WeightShape")), QLSTMLayerNormShapeDataSet< qsymm16_per_vector, 1, 1 >("BiasShape")), framework::dataset::make("DataType", DataType::QSYMM16)), framework::dataset::make("WeightQuantizationInfo", { QuantizationInfo(1./8192), QuantizationInfo(8192) }))), combine(combine(zip(zip(QLSTMLayerNormShapeDataSet< qsymm16_per_vector, 1, 2 >("InputShape"), QLSTMLayerNormShapeDataSet< qsymm16_per_vector, 1, 2 >("WeightShape")), QLSTMLayerNormShapeDataSet< qsymm16_per_vector, 1, 2 >("BiasShape")), framework::dataset::make("DataType", DataType::QSYMM16)), framework::dataset::make("WeightQuantizationInfo", { QuantizationInfo(1./8192), QuantizationInfo(8192) }))))
 
 FIXTURE_DATA_TEST_CASE (RandomValue2D, NEQLSTMLayerNormalizationFixture< int16_t >, framework::DatasetMode::ALL, concat(concat(combine(combine(zip(zip(QLSTMLayerNormShapeDataSet< qsymm16_per_vector, 3, 0 >("InputShape"), QLSTMLayerNormShapeDataSet< qsymm16_per_vector, 1, 0 >("WeightShape")), QLSTMLayerNormShapeDataSet< qsymm16_per_vector, 1, 0 >("BiasShape")), framework::dataset::make("DataType", DataType::QSYMM16)), framework::dataset::make("WeightQuantizationInfo", { QuantizationInfo(1./8192), QuantizationInfo(8192) })), combine(combine(zip(zip(QLSTMLayerNormShapeDataSet< qsymm16_per_vector, 3, 1 >("InputShape"), QLSTMLayerNormShapeDataSet< qsymm16_per_vector, 1, 1 >("WeightShape")), QLSTMLayerNormShapeDataSet< qsymm16_per_vector, 1, 1 >("BiasShape")), framework::dataset::make("DataType", DataType::QSYMM16)), framework::dataset::make("WeightQuantizationInfo", { QuantizationInfo(1./8192), QuantizationInfo(8192) }))), combine(combine(zip(zip(QLSTMLayerNormShapeDataSet< qsymm16_per_vector, 3, 2 >("InputShape"), QLSTMLayerNormShapeDataSet< qsymm16_per_vector, 1, 2 >("WeightShape")), QLSTMLayerNormShapeDataSet< qsymm16_per_vector, 1, 2 >("BiasShape")), framework::dataset::make("DataType", DataType::QSYMM16)), framework::dataset::make("WeightQuantizationInfo", { QuantizationInfo(1./8192), QuantizationInfo(8192) }))))
 

Macro Definition Documentation

◆ QSYMM16_DATASET_1D

#define QSYMM16_DATASET_1D   concat(concat(QSYMM16_DATASET_ITER(1, 0), QSYMM16_DATASET_ITER(1, 1)), QSYMM16_DATASET_ITER(1, 2))

Definition at line 194 of file QLSTMLayerNormalization.cpp.

◆ QSYMM16_DATASET_2D

#define QSYMM16_DATASET_2D   concat(concat(QSYMM16_DATASET_ITER(3, 0), QSYMM16_DATASET_ITER(3, 1)), QSYMM16_DATASET_ITER(3, 2))

Definition at line 197 of file QLSTMLayerNormalization.cpp.

◆ QSYMM16_DATASET_ITER

#define QSYMM16_DATASET_ITER (   num_input_batch,
  num_iter 
)
Value:
combine(combine(zip(zip(QLSTMLayerNormShapeDataSet<qsymm16_per_vector, num_input_batch, num_iter>("InputShape"), \
QLSTMLayerNormShapeDataSet<qsymm16_per_vector, 1, num_iter>("WeightShape")), \
QLSTMLayerNormShapeDataSet<qsymm16_per_vector, 1, num_iter>("BiasShape")), \
framework::dataset::make("DataType", DataType::QSYMM16)), \
framework::dataset::make("WeightQuantizationInfo", { QuantizationInfo(1. / 8192), QuantizationInfo(8192) }))
std::enable_if< is_container< T >::value, ContainerDataset< T > >::type make(std::string name, T &&values)
Helper function to create a ContainerDataset.
CartesianProductDataset< T, U > combine(T &&dataset1, U &&dataset2)
Helper function to create a CartesianProductDataset.
ZipDataset< T, U > zip(T &&dataset1, U &&dataset2)
Helper function to create a ZipDataset.
Definition: ZipDataset.h:149

Definition at line 187 of file QLSTMLayerNormalization.cpp.