From ceb889efc302464efd7fd20001d8a89a06c4e0bd Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Mon, 17 Sep 2018 18:24:41 +0100 Subject: COMPMID-1588 Create UpsampleKernel for YOLOLayer Change-Id: Ic1f9e85306a0a0b1459c9f9aa35bd629deea1710 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/148797 Tested-by: bsgcomp Reviewed-by: Anthony Barbier Reviewed-by: Georgios Pinitas --- arm_compute/core/utils/misc/ShapeCalculator.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'arm_compute/core/utils/misc') diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h index 6d8e15b8b2..1fdf5b8ff5 100644 --- a/arm_compute/core/utils/misc/ShapeCalculator.h +++ b/arm_compute/core/utils/misc/ShapeCalculator.h @@ -597,6 +597,21 @@ inline TensorShape compute_padded_shape(const TensorShape &input_shape, const Pa return padded_shape; } +inline TensorShape compute_upsample_shape(const ITensorInfo &input, const Size2D &info) +{ + const DataLayout data_layout = input.data_layout(); + const int idx_width = get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH); + const int idx_height = get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT); + + TensorShape scale_out_shape(input.tensor_shape()); + const unsigned int out_x = input.dimension(idx_width) * info.x(); + const unsigned int out_y = input.dimension(idx_height) * info.y(); + scale_out_shape.set(idx_width, out_x); + scale_out_shape.set(idx_height, out_y); + + return scale_out_shape; +} + template inline TensorShape extract_shape(T *data) { -- cgit v1.2.1