diff options
author | Michalis Spyrou <michalis.spyrou@arm.com> | 2018-09-17 18:24:41 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:54:54 +0000 |
commit | ceb889efc302464efd7fd20001d8a89a06c4e0bd (patch) | |
tree | eaaef1b1f1a46038bbc8ecf9a9660a79f1f30dc9 /arm_compute/core/utils/misc/ShapeCalculator.h | |
parent | 88b836206e1e4463db2eac4b36d2d7fc8ae2490c (diff) | |
download | ComputeLibrary-ceb889efc302464efd7fd20001d8a89a06c4e0bd.tar.gz |
COMPMID-1588 Create UpsampleKernel for YOLOLayer
Change-Id: Ic1f9e85306a0a0b1459c9f9aa35bd629deea1710
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/148797
Tested-by: bsgcomp <bsgcomp@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'arm_compute/core/utils/misc/ShapeCalculator.h')
-rw-r--r-- | arm_compute/core/utils/misc/ShapeCalculator.h | 15 |
1 files changed, 15 insertions, 0 deletions
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 <typename T> inline TensorShape extract_shape(T *data) { |