From 00854295ac18e1a79d99e6f1692432503cc71448 Mon Sep 17 00:00:00 2001 From: Diego Lopez Recas Date: Thu, 22 Feb 2018 13:08:01 +0000 Subject: COMPMID-959: Fix valid region for Scale Change-Id: Ic9ce52d772a178916dfa60fbb6456d295c06b83d Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/122647 Tested-by: Jenkins Reviewed-by: Anthony Barbier --- arm_compute/core/Helpers.inl | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'arm_compute/core/Helpers.inl') diff --git a/arm_compute/core/Helpers.inl b/arm_compute/core/Helpers.inl index 3db8369f08..b359811328 100644 --- a/arm_compute/core/Helpers.inl +++ b/arm_compute/core/Helpers.inl @@ -300,39 +300,6 @@ inline bool set_quantization_info_if_empty(ITensorInfo &info, QuantizationInfo q return false; } -inline ValidRegion calculate_valid_region_scale(const ITensorInfo &src_info, const TensorShape &dst_shape, InterpolationPolicy policy, BorderSize border_size, bool border_undefined) -{ - const auto wr = static_cast(dst_shape[0]) / static_cast(src_info.tensor_shape()[0]); - const auto hr = static_cast(dst_shape[1]) / static_cast(src_info.tensor_shape()[1]); - - ValidRegion valid_region{ Coordinates(), dst_shape, src_info.tensor_shape().num_dimensions() }; - - Coordinates &anchor = valid_region.anchor; - TensorShape &shape = valid_region.shape; - - anchor.set(0, (policy == InterpolationPolicy::BILINEAR - && border_undefined) ? - ((static_cast(src_info.valid_region().anchor[0]) + border_size.left + 0.5f) * wr - 0.5f) : - ((static_cast(src_info.valid_region().anchor[0]) + 0.5f) * wr - 0.5f)); - anchor.set(1, (policy == InterpolationPolicy::BILINEAR - && border_undefined) ? - ((static_cast(src_info.valid_region().anchor[1]) + border_size.top + 0.5f) * hr - 0.5f) : - ((static_cast(src_info.valid_region().anchor[1]) + 0.5f) * hr - 0.5f)); - float shape_out_x = (policy == InterpolationPolicy::BILINEAR - && border_undefined) ? - ((static_cast(src_info.valid_region().anchor[0]) + static_cast(src_info.valid_region().shape[0]) - 1) - 1 + 0.5f) * wr - 0.5f : - ((static_cast(src_info.valid_region().anchor[0]) + static_cast(src_info.valid_region().shape[0])) + 0.5f) * wr - 0.5f; - float shape_out_y = (policy == InterpolationPolicy::BILINEAR - && border_undefined) ? - ((static_cast(src_info.valid_region().anchor[1]) + static_cast(src_info.valid_region().shape[1]) - 1) - 1 + 0.5f) * hr - 0.5f : - ((static_cast(src_info.valid_region().anchor[1]) + static_cast(src_info.valid_region().shape[1])) + 0.5f) * hr - 0.5f; - - shape.set(0, shape_out_x - anchor[0]); - shape.set(1, shape_out_y - anchor[1]); - - return valid_region; -} - inline Coordinates index2coords(const TensorShape &shape, int index) { int num_elements = shape.total_size(); -- cgit v1.2.1