diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-12-10 13:33:18 +0000 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-12-11 18:04:21 +0000 |
commit | 338435607fc5291ff991f38aa15d4df5097d1a2d (patch) | |
tree | a0c89e9d5fd78e994594b27978b0c8b285d6da4b /tests/validation/reference/ConcatenateLayer.cpp | |
parent | 453f9d9e9be824aa0e4f80abc9a051d8038b0e56 (diff) | |
download | ComputeLibrary-338435607fc5291ff991f38aa15d4df5097d1a2d.tar.gz |
COMPMID-2754: Add support for QASYMM8_SIGNED in NE kernels/functions.
Kernels/Functions extended support:
- NEBatchToSpaceLayerKernel/NEBatchToSpaceLayer
- NEChannelShuffleLayerKernel/NEChannelShuffleLayer
- NECol2ImKernel/NECol2Im
- NEConvertFullyConnectedWeightsKernel/NEConvertFullyConnectedWeights
- NECopyKernel/NECopy
- NEConvolutionLayerReshapeWeights
- NEDepthToSpaceLayerKernel/NEDepthToSpaceLayer
- NEFlattenLayerKernel/NEFlattenLayer
- NEFillBorderKernel
- NEFullyConnectedLayerReshapeWeights
- NEGatherKernel/NEGather
- NEGEMMInterleave4x4Kernel
- NEGEMMTranspose1xWKernel
- NEIm2ColKernel/NEIm2Col
- NEMemsetKernel
- NEPadLayerKernel/NEPadLayer
- NEPermuteKernel/NEPermute
- NEReverseKernel/NEReverse
- NEReorgLayerKernel/NEReorgLayer
- NEReshapeLayerKernel/NEReshapeLayer
- NESplit
- NESlice
- NEStridedSliceKernel/NEStridedSlice
- NESpaceToBatchLayerKernel/NESpaceToBatchLayer
- NESpaceToDepthLayerKernel/NESpaceToDepthLayerKernel
- NEStackLayerKernel/NEStackLayer
- NETileKernel/NETile
- NETransposeKernel/NETranspose
- NEWidthConcatenateLayerKernel/NEHeightConcatenateLayer
- NEHeightConcatenateLayerKernel/NEHeightConcatenateLayer
- NEDepthConcatenateLayerKernel/NEDepthConcatenateLayer
- NEBathConcatenateLayerKernel/NEBatchConcatenateLayer
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: Ia070332ad4c4dbced2541dc46f7f2f3a86833b65
Reviewed-on: https://review.mlplatform.org/c/2442
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/validation/reference/ConcatenateLayer.cpp')
-rw-r--r-- | tests/validation/reference/ConcatenateLayer.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/tests/validation/reference/ConcatenateLayer.cpp b/tests/validation/reference/ConcatenateLayer.cpp index aa74ca2474..266dae1c27 100644 --- a/tests/validation/reference/ConcatenateLayer.cpp +++ b/tests/validation/reference/ConcatenateLayer.cpp @@ -70,16 +70,27 @@ SimpleTensor<T> widthconcatenate_layer(const std::vector<SimpleTensor<T>> &srcs, for(int r = 0; r < height; ++r) { const int offset = u * height * depth + d * height + r; - if(src.data_type() == DataType::QASYMM8 && src.quantization_info() != dst.quantization_info()) + if(is_data_type_quantized(src.data_type()) && src.quantization_info() != dst.quantization_info()) { const UniformQuantizationInfo iq_info = src.quantization_info().uniform(); const UniformQuantizationInfo oq_info = dst.quantization_info().uniform(); - std::transform(src_ptr, src_ptr + width, dst_ptr + width_offset + offset * width_out, [&](T t) + if(src.data_type() == DataType::QASYMM8) { - const float dequantized_input = dequantize_qasymm8(t, iq_info); - return quantize_qasymm8(dequantized_input, oq_info); - }); + std::transform(src_ptr, src_ptr + width, dst_ptr + width_offset + offset * width_out, [&](T t) + { + const float dequantized_input = dequantize_qasymm8(t, iq_info); + return quantize_qasymm8(dequantized_input, oq_info); + }); + } + else + { + std::transform(src_ptr, src_ptr + width, dst_ptr + width_offset + offset * width_out, [&](T t) + { + const float dequantized_input = dequantize_qasymm8_signed(t, iq_info); + return quantize_qasymm8_signed(dequantized_input, oq_info); + }); + } src_ptr += width; } else @@ -98,6 +109,7 @@ SimpleTensor<T> widthconcatenate_layer(const std::vector<SimpleTensor<T>> &srcs, template SimpleTensor<float> widthconcatenate_layer(const std::vector<SimpleTensor<float>> &srcs, SimpleTensor<float> &dst); template SimpleTensor<half> widthconcatenate_layer(const std::vector<SimpleTensor<half>> &srcs, SimpleTensor<half> &dst); template SimpleTensor<uint8_t> widthconcatenate_layer(const std::vector<SimpleTensor<uint8_t>> &srcs, SimpleTensor<uint8_t> &dst); +template SimpleTensor<int8_t> widthconcatenate_layer(const std::vector<SimpleTensor<int8_t>> &srcs, SimpleTensor<int8_t> &dst); } // namespace template <typename T> @@ -148,6 +160,7 @@ SimpleTensor<T> concatenate_layer(std::vector<SimpleTensor<T>> &srcs, SimpleTens template SimpleTensor<float> concatenate_layer(std::vector<SimpleTensor<float>> &srcs, SimpleTensor<float> &dst, unsigned int axis); template SimpleTensor<half> concatenate_layer(std::vector<SimpleTensor<half>> &srcs, SimpleTensor<half> &dst, unsigned int axis); template SimpleTensor<uint8_t> concatenate_layer(std::vector<SimpleTensor<uint8_t>> &srcs, SimpleTensor<uint8_t> &dst, unsigned int axis); +template SimpleTensor<int8_t> concatenate_layer(std::vector<SimpleTensor<int8_t>> &srcs, SimpleTensor<int8_t> &dst, unsigned int axis); } // namespace reference } // namespace validation } // namespace test |