From 4aff98fcfd3c736115f3983dc448c3280e570841 Mon Sep 17 00:00:00 2001 From: Michele Di Giorgio Date: Wed, 28 Aug 2019 16:27:26 +0100 Subject: COMPMID-2247: Extend support of CLBoundingBoxTransform for QUANT16_ASYMM Change-Id: I8af7a382c0bccf55cf7f4a64f46ce9e6cd965afe Signed-off-by: Michele Di Giorgio Reviewed-on: https://review.mlplatform.org/c/1833 Comments-Addressed: Arm Jenkins Reviewed-by: Pablo Marquez Tested-by: Arm Jenkins --- tests/validation/CL/BoundingBoxTransform.cpp | 17 ++ tests/validation/Helpers.cpp | 14 ++ tests/validation/Helpers.h | 11 +- .../fixtures/BoundingBoxTransformFixture.h | 205 ++++++++++++++------- tests/validation/reference/ActivationLayer.cpp | 2 +- .../validation/reference/ArithmeticOperations.cpp | 2 +- .../validation/reference/BoundingBoxTransform.cpp | 40 ++-- tests/validation/reference/BoundingBoxTransform.h | 6 +- .../validation/reference/ElementwiseOperations.cpp | 2 +- .../reference/NormalizePlanarYUVLayer.cpp | 4 +- .../reference/PixelWiseMultiplication.cpp | 2 +- tests/validation/reference/PoolingLayer.cpp | 2 +- tests/validation/reference/ROIAlignLayer.cpp | 2 +- tests/validation/reference/Range.cpp | 4 +- tests/validation/reference/ReductionOperation.cpp | 2 +- tests/validation/reference/Scale.cpp | 2 +- tests/validation/reference/SoftmaxLayer.cpp | 4 +- tests/validation/reference/UpsampleLayer.cpp | 2 +- tests/validation/reference/YOLOLayer.cpp | 4 +- 19 files changed, 222 insertions(+), 105 deletions(-) (limited to 'tests') diff --git a/tests/validation/CL/BoundingBoxTransform.cpp b/tests/validation/CL/BoundingBoxTransform.cpp index b6334b5868..2491e185d8 100644 --- a/tests/validation/CL/BoundingBoxTransform.cpp +++ b/tests/validation/CL/BoundingBoxTransform.cpp @@ -46,6 +46,8 @@ AbsoluteTolerance absolute_tolerance_f32(0.001f); RelativeTolerance relative_tolerance_f16(half(0.2)); AbsoluteTolerance absolute_tolerance_f16(half(0.02f)); +constexpr AbsoluteTolerance tolerance_qasymm16(1); + // *INDENT-OFF* // clang-format off const auto BboxInfoDataset = framework::dataset::make("BboxInfo", { BoundingBoxTransformInfo(20U, 20U, 2U, true), @@ -128,6 +130,21 @@ FIXTURE_DATA_TEST_CASE(BoundingBox, CLBoundingBoxTransformFixture, framewo TEST_SUITE_END() // FP16 TEST_SUITE_END() // Float +template +using CLBoundingBoxTransformQuantizedFixture = BoundingBoxTransformQuantizedFixture; + +TEST_SUITE(Quantized) +TEST_SUITE(QASYMM16) +FIXTURE_DATA_TEST_CASE(BoundingBox, CLBoundingBoxTransformQuantizedFixture, framework::DatasetMode::ALL, + combine(combine(combine(DeltaDataset, BboxInfoDataset), framework::dataset::make("DataType", { DataType::QASYMM16 })), + framework::dataset::make("DeltasQuantInfo", { QuantizationInfo(1.f / 255.f, 127) }))) +{ + // Validate output + validate(CLAccessor(_target), _reference, tolerance_qasymm16); +} +TEST_SUITE_END() // QASYMM16 +TEST_SUITE_END() // Quantized + TEST_SUITE_END() // BBoxTransform TEST_SUITE_END() // CL } // namespace validation diff --git a/tests/validation/Helpers.cpp b/tests/validation/Helpers.cpp index a811cabf56..4158793295 100644 --- a/tests/validation/Helpers.cpp +++ b/tests/validation/Helpers.cpp @@ -132,6 +132,7 @@ SimpleTensor convert_from_asymmetric(const SimpleTensor &src) return dst; } +template <> SimpleTensor convert_to_asymmetric(const SimpleTensor &src, const QuantizationInfo &quantization_info) { SimpleTensor dst{ src.shape(), DataType::QASYMM8, 1, quantization_info }; @@ -144,6 +145,19 @@ SimpleTensor convert_to_asymmetric(const SimpleTensor &src, cons return dst; } +template <> +SimpleTensor convert_to_asymmetric(const SimpleTensor &src, const QuantizationInfo &quantization_info) +{ + SimpleTensor dst{ src.shape(), DataType::QASYMM16, 1, quantization_info }; + const UniformQuantizationInfo &qinfo = quantization_info.uniform(); + + for(int i = 0; i < src.num_elements(); ++i) + { + dst[i] = quantize_qasymm16(src[i], qinfo); + } + return dst; +} + template <> SimpleTensor convert_to_symmetric(const SimpleTensor &src, const QuantizationInfo &quantization_info) { diff --git a/tests/validation/Helpers.h b/tests/validation/Helpers.h index 0d6515b5c5..2ee2dc7aab 100644 --- a/tests/validation/Helpers.h +++ b/tests/validation/Helpers.h @@ -200,7 +200,16 @@ SimpleTensor convert_from_asymmetric(const SimpleTensor &src); * * @return Quantized tensor. */ -SimpleTensor convert_to_asymmetric(const SimpleTensor &src, const QuantizationInfo &quantization_info); +template +SimpleTensor convert_to_asymmetric(const SimpleTensor &src, const QuantizationInfo &quantization_info); + +/** Convert quantized simple tensor into float using tensor quantization information. + * + * @param[in] src Quantized tensor. + * + * @return Float tensor. + */ +SimpleTensor convert_from_asymmetric(const SimpleTensor &src); /** Convert quantized simple tensor into float using tensor quantization information. * diff --git a/tests/validation/fixtures/BoundingBoxTransformFixture.h b/tests/validation/fixtures/BoundingBoxTransformFixture.h index b71da8e97d..5e4c598f73 100644 --- a/tests/validation/fixtures/BoundingBoxTransformFixture.h +++ b/tests/validation/fixtures/BoundingBoxTransformFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 ARM Limited. + * Copyright (c) 2018-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -40,28 +40,117 @@ namespace test { namespace validation { +namespace +{ +std::vector generate_deltas(std::vector &boxes, const TensorShape &image_shape, size_t num_boxes, size_t num_classes, std::mt19937 &gen) +{ + std::vector deltas(num_boxes * 4 * num_classes); + + std::uniform_int_distribution<> dist_x1(0, image_shape[0] - 1); + std::uniform_int_distribution<> dist_y1(0, image_shape[1] - 1); + std::uniform_int_distribution<> dist_w(1, image_shape[0]); + std::uniform_int_distribution<> dist_h(1, image_shape[1]); + + for(size_t i = 0; i < num_boxes; ++i) + { + const float ex_width = boxes[4 * i + 2] - boxes[4 * i] + 1.f; + const float ex_height = boxes[4 * i + 3] - boxes[4 * i + 1] + 1.f; + const float ex_ctr_x = boxes[4 * i] + 0.5f * ex_width; + const float ex_ctr_y = boxes[4 * i + 1] + 0.5f * ex_height; + + for(size_t j = 0; j < num_classes; ++j) + { + const float x1 = dist_x1(gen); + const float y1 = dist_y1(gen); + const float width = dist_w(gen); + const float height = dist_h(gen); + const float ctr_x = x1 + 0.5f * width; + const float ctr_y = y1 + 0.5f * height; + + deltas[4 * num_classes * i + 4 * j] = (ctr_x - ex_ctr_x) / ex_width; + deltas[4 * num_classes * i + 4 * j + 1] = (ctr_y - ex_ctr_y) / ex_height; + deltas[4 * num_classes * i + 4 * j + 2] = log(width / ex_width); + deltas[4 * num_classes * i + 4 * j + 3] = log(height / ex_height); + } + } + return deltas; +} + +std::vector generate_boxes(const TensorShape &image_shape, size_t num_boxes, std::mt19937 &gen) +{ + std::vector boxes(num_boxes * 4); + + std::uniform_int_distribution<> dist_x1(0, image_shape[0] - 1); + std::uniform_int_distribution<> dist_y1(0, image_shape[1] - 1); + std::uniform_int_distribution<> dist_w(1, image_shape[0]); + std::uniform_int_distribution<> dist_h(1, image_shape[1]); + + for(size_t i = 0; i < num_boxes; ++i) + { + boxes[4 * i] = dist_x1(gen); + boxes[4 * i + 1] = dist_y1(gen); + boxes[4 * i + 2] = boxes[4 * i] + dist_w(gen) - 1; + boxes[4 * i + 3] = boxes[4 * i + 1] + dist_h(gen) - 1; + } + return boxes; +} +} // namespace + template -class BoundingBoxTransformFixture : public framework::Fixture +class BoundingBoxTransformGenericFixture : public framework::Fixture { public: + using TDeltas = typename std::conditional::type, uint16_t>::value, uint8_t, T>::type; + template - void setup(TensorShape deltas_shape, const BoundingBoxTransformInfo &info, DataType data_type) + void setup(TensorShape deltas_shape, const BoundingBoxTransformInfo &info, DataType data_type, QuantizationInfo deltas_qinfo) { + const bool is_qasymm16 = data_type == DataType::QASYMM16; + _data_type_deltas = (is_qasymm16) ? DataType::QASYMM8 : data_type; + _boxes_qinfo = (is_qasymm16) ? QuantizationInfo(.125f, 0) : QuantizationInfo(); + std::mt19937 gen_target(library->seed()); - _target = compute_target(deltas_shape, data_type, info, gen_target); + _target = compute_target(deltas_shape, data_type, info, gen_target, deltas_qinfo); std::mt19937 gen_reference(library->seed()); - _reference = compute_reference(deltas_shape, data_type, info, gen_reference); + _reference = compute_reference(deltas_shape, data_type, info, gen_reference, deltas_qinfo); } protected: + template + void fill(U &&tensor, std::vector values) + { + data_type *data_ptr = reinterpret_cast(tensor.data()); + switch(tensor.data_type()) + { + case DataType::QASYMM8: + for(size_t i = 0; i < values.size(); ++i) + { + data_ptr[i] = quantize_qasymm8(values[i], tensor.quantization_info()); + } + break; + case DataType::QASYMM16: + for(size_t i = 0; i < values.size(); ++i) + { + data_ptr[i] = quantize_qasymm16(values[i], tensor.quantization_info()); + } + break; + default: + for(size_t i = 0; i < values.size(); ++i) + { + data_ptr[i] = static_cast(values[i]); + } + } + } + TensorType compute_target(const TensorShape &deltas_shape, DataType data_type, - const BoundingBoxTransformInfo &bbox_info, std::mt19937 &gen) + const BoundingBoxTransformInfo &bbox_info, std::mt19937 &gen, + QuantizationInfo deltas_qinfo) { // Create tensors TensorShape boxes_shape(4, deltas_shape[1]); - TensorType deltas = create_tensor(deltas_shape, data_type); - TensorType boxes = create_tensor(boxes_shape, data_type); + TensorType deltas = create_tensor(deltas_shape, _data_type_deltas, 1, deltas_qinfo); + TensorType boxes = create_tensor(boxes_shape, data_type, 1, _boxes_qinfo); TensorType pred_boxes; // Create and configure function @@ -81,9 +170,11 @@ protected: ARM_COMPUTE_EXPECT(!boxes.info()->is_resizable(), framework::LogLevel::ERRORS); // Fill tensors - TensorShape img_shape(bbox_info.scale() * bbox_info.img_width(), bbox_info.scale() * bbox_info.img_height()); - generate_boxes(AccessorType(boxes), img_shape, boxes_shape[1], gen); - generate_deltas(AccessorType(deltas), AccessorType(boxes), img_shape, deltas_shape[1], deltas_shape[0] / 4, gen); + TensorShape img_shape(bbox_info.scale() * bbox_info.img_width(), bbox_info.scale() * bbox_info.img_height()); + std::vector boxes_vec = generate_boxes(img_shape, boxes_shape[1], gen); + std::vector deltas_vec = generate_deltas(boxes_vec, img_shape, deltas_shape[1], deltas_shape[0] / 4, gen); + fill(AccessorType(boxes), boxes_vec); + fill(AccessorType(deltas), deltas_vec); // Compute function bbox_transform.run(); @@ -93,80 +184,56 @@ protected: SimpleTensor compute_reference(const TensorShape &deltas_shape, DataType data_type, - const BoundingBoxTransformInfo &bbox_info, std::mt19937 &gen) + const BoundingBoxTransformInfo &bbox_info, + std::mt19937 &gen, + QuantizationInfo deltas_qinfo) { // Create reference tensor - TensorShape boxes_shape(4, deltas_shape[1]); - SimpleTensor boxes{ boxes_shape, data_type }; - SimpleTensor deltas{ deltas_shape, data_type }; + TensorShape boxes_shape(4, deltas_shape[1]); + SimpleTensor boxes{ boxes_shape, data_type, 1, _boxes_qinfo }; + SimpleTensor deltas{ deltas_shape, _data_type_deltas, 1, deltas_qinfo }; // Fill reference tensor - TensorShape img_shape(bbox_info.scale() * bbox_info.img_width(), bbox_info.scale() * bbox_info.img_height()); - generate_boxes(boxes, img_shape, boxes_shape[1], gen); - generate_deltas(deltas, boxes, img_shape, deltas_shape[1], deltas_shape[0] / 4, gen); + TensorShape img_shape(bbox_info.scale() * bbox_info.img_width(), bbox_info.scale() * bbox_info.img_height()); + std::vector boxes_vec = generate_boxes(img_shape, boxes_shape[1], gen); + std::vector deltas_vec = generate_deltas(boxes_vec, img_shape, deltas_shape[1], deltas_shape[0] / 4, gen); + fill(boxes, boxes_vec); + fill(deltas, deltas_vec); return reference::bounding_box_transform(boxes, deltas, bbox_info); } - TensorType _target{}; - SimpleTensor _reference{}; + TensorType _target{}; + SimpleTensor _reference{}; + DataType _data_type_deltas{}; + QuantizationInfo _boxes_qinfo{}; private: - template - void generate_deltas(U &&deltas, U &&boxes, const TensorShape &image_shape, size_t num_boxes, size_t num_classes, std::mt19937 &gen) - { - T *deltas_ptr = static_cast(deltas.data()); - T *boxes_ptr = static_cast(boxes.data()); - - std::uniform_int_distribution<> dist_x1(0, image_shape[0] - 1); - std::uniform_int_distribution<> dist_y1(0, image_shape[1] - 1); - std::uniform_int_distribution<> dist_w(1, image_shape[0]); - std::uniform_int_distribution<> dist_h(1, image_shape[1]); - - for(size_t i = 0; i < num_boxes; ++i) - { - const T ex_width = boxes_ptr[4 * i + 2] - boxes_ptr[4 * i] + T(1); - const T ex_height = boxes_ptr[4 * i + 3] - boxes_ptr[4 * i + 1] + T(1); - const T ex_ctr_x = boxes_ptr[4 * i] + T(0.5) * ex_width; - const T ex_ctr_y = boxes_ptr[4 * i + 1] + T(0.5) * ex_height; - - for(size_t j = 0; j < num_classes; ++j) - { - const T x1 = T(dist_x1(gen)); - const T y1 = T(dist_y1(gen)); - const T width = T(dist_w(gen)); - const T height = T(dist_h(gen)); - const T ctr_x = x1 + T(0.5) * width; - const T ctr_y = y1 + T(0.5) * height; - - deltas_ptr[4 * num_classes * i + 4 * j] = (ctr_x - ex_ctr_x) / ex_width; - deltas_ptr[4 * num_classes * i + 4 * j + 1] = (ctr_y - ex_ctr_y) / ex_height; - deltas_ptr[4 * num_classes * i + 4 * j + 2] = log(width / ex_width); - deltas_ptr[4 * num_classes * i + 4 * j + 3] = log(height / ex_height); - } - } - } +}; - template - void generate_boxes(U &&boxes, const TensorShape &image_shape, size_t num_boxes, std::mt19937 &gen) +template +class BoundingBoxTransformFixture : public BoundingBoxTransformGenericFixture +{ +public: + template + void setup(TensorShape deltas_shape, const BoundingBoxTransformInfo &info, DataType data_type) { - T *boxes_ptr = (T *)boxes.data(); + BoundingBoxTransformGenericFixture::setup(deltas_shape, info, data_type, QuantizationInfo()); + } - std::uniform_int_distribution<> dist_x1(0, image_shape[0] - 1); - std::uniform_int_distribution<> dist_y1(0, image_shape[1] - 1); - std::uniform_int_distribution<> dist_w(1, image_shape[0]); - std::uniform_int_distribution<> dist_h(1, image_shape[1]); +private: +}; - for(size_t i = 0; i < num_boxes; ++i) - { - boxes_ptr[4 * i] = dist_x1(gen); - boxes_ptr[4 * i + 1] = dist_y1(gen); - boxes_ptr[4 * i + 2] = boxes_ptr[4 * i] + dist_w(gen) - 1; - boxes_ptr[4 * i + 3] = boxes_ptr[4 * i + 1] + dist_h(gen) - 1; - } +template +class BoundingBoxTransformQuantizedFixture : public BoundingBoxTransformGenericFixture +{ +public: + template + void setup(TensorShape deltas_shape, const BoundingBoxTransformInfo &info, DataType data_type, QuantizationInfo deltas_qinfo) + { + BoundingBoxTransformGenericFixture::setup(deltas_shape, info, data_type, deltas_qinfo); } }; - } // namespace validation } // namespace test } // namespace arm_compute diff --git a/tests/validation/reference/ActivationLayer.cpp b/tests/validation/reference/ActivationLayer.cpp index f573d12df8..6cdba09c75 100644 --- a/tests/validation/reference/ActivationLayer.cpp +++ b/tests/validation/reference/ActivationLayer.cpp @@ -61,7 +61,7 @@ SimpleTensor activation_layer(const SimpleTensor &src SimpleTensor src_tmp = convert_from_asymmetric(src); SimpleTensor dst_tmp = activation_layer(src_tmp, info); - SimpleTensor dst = convert_to_asymmetric(dst_tmp, dst_qinfo); + SimpleTensor dst = convert_to_asymmetric(dst_tmp, dst_qinfo); return dst; } diff --git a/tests/validation/reference/ArithmeticOperations.cpp b/tests/validation/reference/ArithmeticOperations.cpp index abd4f31d72..0ec328ee6a 100644 --- a/tests/validation/reference/ArithmeticOperations.cpp +++ b/tests/validation/reference/ArithmeticOperations.cpp @@ -112,7 +112,7 @@ SimpleTensor arithmetic_operation(ArithmeticOperation op, const SimpleT BroadcastUnroll::unroll(op, src1_tmp, src2_tmp, dst_tmp, convert_policy, id_src1, id_src2, id_dst); - dst = convert_to_asymmetric(dst_tmp, dst.quantization_info()); + dst = convert_to_asymmetric(dst_tmp, dst.quantization_info()); return dst; } else diff --git a/tests/validation/reference/BoundingBoxTransform.cpp b/tests/validation/reference/BoundingBoxTransform.cpp index 55dd165b51..e09bcff1c6 100644 --- a/tests/validation/reference/BoundingBoxTransform.cpp +++ b/tests/validation/reference/BoundingBoxTransform.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 ARM Limited. + * Copyright (c) 2018-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -36,16 +36,16 @@ namespace validation { namespace reference { -template -SimpleTensor bounding_box_transform(const SimpleTensor &boxes, const SimpleTensor &deltas, const BoundingBoxTransformInfo &info) +template +SimpleTensor bounding_box_transform(const SimpleTensor &boxes, const SimpleTensor &deltas, const BoundingBoxTransformInfo &info) { - const DataType boxes_data_type = deltas.data_type(); + const DataType boxes_data_type = boxes.data_type(); SimpleTensor pred_boxes(deltas.shape(), boxes_data_type); - const size_t num_classes = deltas.shape()[0] / 4; - const size_t num_boxes = deltas.shape()[1]; - const T *deltas_ptr = deltas.data(); - T *pred_boxes_ptr = pred_boxes.data(); + const size_t num_classes = deltas.shape()[0] / 4; + const size_t num_boxes = deltas.shape()[1]; + const TDeltas *deltas_ptr = deltas.data(); + T *pred_boxes_ptr = pred_boxes.data(); const int img_h = floor(info.img_height() / info.scale() + 0.5f); const int img_w = floor(info.img_width() / info.scale() + 0.5f); @@ -70,15 +70,15 @@ SimpleTensor bounding_box_transform(const SimpleTensor &boxes, const Simpl for(size_t j = 0; j < num_classes; ++j) { // Extract deltas - const size_t start_delta = i * num_classes * class_fields + class_fields * j; - const T dx = deltas_ptr[start_delta] / T(info.weights()[0]); - const T dy = deltas_ptr[start_delta + 1] / T(info.weights()[1]); - T dw = deltas_ptr[start_delta + 2] / T(info.weights()[2]); - T dh = deltas_ptr[start_delta + 3] / T(info.weights()[3]); + const size_t start_delta = i * num_classes * class_fields + class_fields * j; + const TDeltas dx = deltas_ptr[start_delta] / TDeltas(info.weights()[0]); + const TDeltas dy = deltas_ptr[start_delta + 1] / TDeltas(info.weights()[1]); + TDeltas dw = deltas_ptr[start_delta + 2] / TDeltas(info.weights()[2]); + TDeltas dh = deltas_ptr[start_delta + 3] / TDeltas(info.weights()[3]); // Clip dw and dh - dw = std::min(dw, T(info.bbox_xform_clip())); - dh = std::min(dh, T(info.bbox_xform_clip())); + dw = std::min(dw, TDeltas(info.bbox_xform_clip())); + dh = std::min(dh, TDeltas(info.bbox_xform_clip())); // Determine the predictions const T pred_ctr_x = dx * width + ctr_x; @@ -98,6 +98,16 @@ SimpleTensor bounding_box_transform(const SimpleTensor &boxes, const Simpl template SimpleTensor bounding_box_transform(const SimpleTensor &boxes, const SimpleTensor &deltas, const BoundingBoxTransformInfo &info); template SimpleTensor bounding_box_transform(const SimpleTensor &boxes, const SimpleTensor &deltas, const BoundingBoxTransformInfo &info); + +template <> +SimpleTensor bounding_box_transform(const SimpleTensor &boxes, const SimpleTensor &deltas, const BoundingBoxTransformInfo &info) +{ + SimpleTensor boxes_tmp = convert_from_asymmetric(boxes); + SimpleTensor deltas_tmp = convert_from_asymmetric(deltas); + SimpleTensor pred_boxes_tmp = bounding_box_transform(boxes_tmp, deltas_tmp, info); + SimpleTensor pred_boxes = convert_to_asymmetric(pred_boxes_tmp, boxes.quantization_info()); + return pred_boxes; +} } // namespace reference } // namespace validation } // namespace test diff --git a/tests/validation/reference/BoundingBoxTransform.h b/tests/validation/reference/BoundingBoxTransform.h index 33ef9d984f..dbe2a147e9 100644 --- a/tests/validation/reference/BoundingBoxTransform.h +++ b/tests/validation/reference/BoundingBoxTransform.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 ARM Limited. + * Copyright (c) 2018-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -38,8 +38,8 @@ namespace validation { namespace reference { -template -SimpleTensor bounding_box_transform(const SimpleTensor &boxes, const SimpleTensor &deltas, const BoundingBoxTransformInfo &info); +template +SimpleTensor bounding_box_transform(const SimpleTensor &boxes, const SimpleTensor &deltas, const BoundingBoxTransformInfo &info); } // namespace reference } // namespace validation } // namespace test diff --git a/tests/validation/reference/ElementwiseOperations.cpp b/tests/validation/reference/ElementwiseOperations.cpp index d5a37a0fae..7b39e18bd9 100644 --- a/tests/validation/reference/ElementwiseOperations.cpp +++ b/tests/validation/reference/ElementwiseOperations.cpp @@ -168,7 +168,7 @@ SimpleTensor arithmetic_operation(ArithmeticOperation op, const SimpleT BroadcastUnroll::unroll(op, src1_tmp, src2_tmp, dst_tmp, convert_policy, id_src1, id_src2, id_dst); - dst = convert_to_asymmetric(dst_tmp, dst.quantization_info()); + dst = convert_to_asymmetric(dst_tmp, dst.quantization_info()); return dst; } else diff --git a/tests/validation/reference/NormalizePlanarYUVLayer.cpp b/tests/validation/reference/NormalizePlanarYUVLayer.cpp index 563e2a7444..ea0e75a3c7 100644 --- a/tests/validation/reference/NormalizePlanarYUVLayer.cpp +++ b/tests/validation/reference/NormalizePlanarYUVLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 ARM Limited. + * Copyright (c) 2017-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -68,7 +68,7 @@ SimpleTensor normalize_planar_yuv_layer(const SimpleTensor mean_tmp = convert_from_asymmetric(mean); SimpleTensor std_tmp = convert_from_asymmetric(std); SimpleTensor dst_tmp = normalize_planar_yuv_layer(src_tmp, mean_tmp, std_tmp); - SimpleTensor dst = convert_to_asymmetric(dst_tmp, src.quantization_info()); + SimpleTensor dst = convert_to_asymmetric(dst_tmp, src.quantization_info()); return dst; } diff --git a/tests/validation/reference/PixelWiseMultiplication.cpp b/tests/validation/reference/PixelWiseMultiplication.cpp index 41a919249e..d9895e5ed9 100644 --- a/tests/validation/reference/PixelWiseMultiplication.cpp +++ b/tests/validation/reference/PixelWiseMultiplication.cpp @@ -160,7 +160,7 @@ SimpleTensor pixel_wise_multiplication(const SimpleTensor &src SimpleTensor src1_tmp = convert_from_asymmetric(src1); SimpleTensor src2_tmp = convert_from_asymmetric(src2); SimpleTensor dst_tmp = pixel_wise_multiplication(src1_tmp, src2_tmp, scale, convert_policy, rounding_policy, qout); - dst = convert_to_asymmetric(dst_tmp, qout); + dst = convert_to_asymmetric(dst_tmp, qout); } else { diff --git a/tests/validation/reference/PoolingLayer.cpp b/tests/validation/reference/PoolingLayer.cpp index f4112a486d..34b19ffb4f 100644 --- a/tests/validation/reference/PoolingLayer.cpp +++ b/tests/validation/reference/PoolingLayer.cpp @@ -157,7 +157,7 @@ SimpleTensor pooling_layer(const SimpleTensor &src, c { SimpleTensor src_tmp = convert_from_asymmetric(src); SimpleTensor dst_tmp = pooling_layer(src_tmp, info, output_qinfo); - SimpleTensor dst = convert_to_asymmetric(dst_tmp, output_qinfo); + SimpleTensor dst = convert_to_asymmetric(dst_tmp, output_qinfo); return dst; } diff --git a/tests/validation/reference/ROIAlignLayer.cpp b/tests/validation/reference/ROIAlignLayer.cpp index 8ad78ff915..415b483bc0 100644 --- a/tests/validation/reference/ROIAlignLayer.cpp +++ b/tests/validation/reference/ROIAlignLayer.cpp @@ -209,7 +209,7 @@ SimpleTensor roi_align_layer(const SimpleTensor &src, const Si SimpleTensor src_tmp = convert_from_asymmetric(src); SimpleTensor rois_tmp = convert_rois_from_asymmetric(rois); SimpleTensor dst_tmp = roi_align_layer(src_tmp, rois_tmp, pool_info, output_qinfo); - SimpleTensor dst = convert_to_asymmetric(dst_tmp, output_qinfo); + SimpleTensor dst = convert_to_asymmetric(dst_tmp, output_qinfo); return dst; } } // namespace reference diff --git a/tests/validation/reference/Range.cpp b/tests/validation/reference/Range.cpp index c24512fa9d..ad1345425a 100644 --- a/tests/validation/reference/Range.cpp +++ b/tests/validation/reference/Range.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 ARM Limited. + * Copyright (c) 2018-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -60,7 +60,7 @@ SimpleTensor range(SimpleTensor &dst, float start, const size_ { SimpleTensor dst_tmp{ dst.shape(), DataType::F32, 1 }; generate_range(dst_tmp, start, num_of_elements, step); - return convert_to_asymmetric(dst_tmp, dst.quantization_info()); + return convert_to_asymmetric(dst_tmp, dst.quantization_info()); } generate_range(dst, start, num_of_elements, step); return dst; diff --git a/tests/validation/reference/ReductionOperation.cpp b/tests/validation/reference/ReductionOperation.cpp index fe128cc6ac..965365db9d 100644 --- a/tests/validation/reference/ReductionOperation.cpp +++ b/tests/validation/reference/ReductionOperation.cpp @@ -281,7 +281,7 @@ SimpleTensor reduction_operation(const SimpleTensor &src, cons { SimpleTensor src_f = convert_from_asymmetric(src); SimpleTensor dst_f = reference::reduction_operation(src_f, dst_shape, axis, op); - return convert_to_asymmetric(dst_f, src.quantization_info()); + return convert_to_asymmetric(dst_f, src.quantization_info()); } else { diff --git a/tests/validation/reference/Scale.cpp b/tests/validation/reference/Scale.cpp index 63a2853c66..4405e79263 100644 --- a/tests/validation/reference/Scale.cpp +++ b/tests/validation/reference/Scale.cpp @@ -196,7 +196,7 @@ SimpleTensor scale(const SimpleTensor &src, float scale_x, flo SimpleTensor src_tmp = convert_from_asymmetric(src); float constant_border_value_f = dequantize_qasymm8(constant_border_value, src.quantization_info()); SimpleTensor dst_tmp = scale_core(src_tmp, scale_x, scale_y, policy, border_mode, constant_border_value_f, sampling_policy, ceil_policy_scale); - dst = convert_to_asymmetric(dst_tmp, src.quantization_info()); + dst = convert_to_asymmetric(dst_tmp, src.quantization_info()); } else { diff --git a/tests/validation/reference/SoftmaxLayer.cpp b/tests/validation/reference/SoftmaxLayer.cpp index f1b94c0a02..fabc62bedb 100644 --- a/tests/validation/reference/SoftmaxLayer.cpp +++ b/tests/validation/reference/SoftmaxLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 ARM Limited. + * Copyright (c) 2017-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -90,7 +90,7 @@ SimpleTensor softmax_layer(const SimpleTensor &src, float beta, size_t axi SimpleTensor src_tmp = convert_from_asymmetric(src); SimpleTensor dst_tmp = softmax_layer(src_tmp, beta, axis); - SimpleTensor dst = convert_to_asymmetric(dst_tmp, output_quantization_info); + SimpleTensor dst = convert_to_asymmetric(dst_tmp, output_quantization_info); return dst; } diff --git a/tests/validation/reference/UpsampleLayer.cpp b/tests/validation/reference/UpsampleLayer.cpp index 8e36ee857e..79d726796a 100644 --- a/tests/validation/reference/UpsampleLayer.cpp +++ b/tests/validation/reference/UpsampleLayer.cpp @@ -93,7 +93,7 @@ SimpleTensor upsample_layer(const SimpleTensor &src, const Siz { SimpleTensor src_tmp = convert_from_asymmetric(src); SimpleTensor dst_tmp = upsample_function(src_tmp, info, policy); - dst = convert_to_asymmetric(dst_tmp, src.quantization_info()); + dst = convert_to_asymmetric(dst_tmp, src.quantization_info()); } else { diff --git a/tests/validation/reference/YOLOLayer.cpp b/tests/validation/reference/YOLOLayer.cpp index a12f411680..cf5e256cf9 100644 --- a/tests/validation/reference/YOLOLayer.cpp +++ b/tests/validation/reference/YOLOLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 ARM Limited. + * Copyright (c) 2018-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -68,7 +68,7 @@ SimpleTensor yolo_layer(const SimpleTensor &src, cons { SimpleTensor src_tmp = convert_from_asymmetric(src); SimpleTensor dst_tmp = yolo_layer(src_tmp, info, num_classes); - SimpleTensor dst = convert_to_asymmetric(dst_tmp, src.quantization_info()); + SimpleTensor dst = convert_to_asymmetric(dst_tmp, src.quantization_info()); return dst; } -- cgit v1.2.1