diff options
author | George Wort <george.wort@arm.com> | 2019-01-08 11:41:54 +0000 |
---|---|---|
committer | George Wort <george.wort@arm.com> | 2019-01-16 15:55:43 +0000 |
commit | 44b4e974590f1a6a07b235f203006cc9010b37e8 (patch) | |
tree | 1f7f76712847e9b7269bc56f972006dd9902ea3c /arm_compute/core/utils/misc | |
parent | f63885bc445af1329e6a5c44d94b5c5d78146b2c (diff) | |
download | ComputeLibrary-44b4e974590f1a6a07b235f203006cc9010b37e8.tar.gz |
COMPMID-1794: Add support for NHWC in CLROIAlignLayer
Change-Id: If1df8f6c0549c986e607cbceb0977c80b2891b75
Reviewed-on: https://review.mlplatform.org/493
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Isabella Gottardi <isabella.gottardi@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Diffstat (limited to 'arm_compute/core/utils/misc')
-rw-r--r-- | arm_compute/core/utils/misc/ShapeCalculator.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h index f8a6df7fe7..35e21679d2 100644 --- a/arm_compute/core/utils/misc/ShapeCalculator.h +++ b/arm_compute/core/utils/misc/ShapeCalculator.h @@ -745,6 +745,28 @@ inline TensorShape compute_pool_shape(const ITensorInfo &input, PoolingLayerInfo return output_shape; } +/** Calculate the output roi align shape of a tensor + * + * @param[in] input Input tensor info + * @param[in] rois Rois tensor info + * @param[in] pool_info Pooling layer info + * + * @return the calculated shape + */ +inline TensorShape compute_roi_align_shape(const ITensorInfo &input, const ITensorInfo &rois, ROIPoolingLayerInfo pool_info) +{ + TensorShape output_shape{ input.tensor_shape() }; + + const unsigned int idx_width = get_data_layout_dimension_index(input.data_layout(), DataLayoutDimension::WIDTH); + const unsigned int idx_height = get_data_layout_dimension_index(input.data_layout(), DataLayoutDimension::HEIGHT); + + output_shape.set(idx_width, pool_info.pooled_width()); + output_shape.set(idx_height, pool_info.pooled_height()); + output_shape.set(3, rois.dimension(1)); + + return output_shape; +} + /** Calculate the RNN shape of a tensor * * @param[in] input Input tensor info |