diff options
author | Michalis Spyrou <michalis.spyrou@arm.com> | 2018-08-21 18:03:58 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:54:54 +0000 |
commit | 16934a511ccd37a28000a9fabb3e6e5fc6f51ec9 (patch) | |
tree | 2c7875d92b4ede16ef6efc63033a2ad31ba68bc0 /arm_compute/core/utils | |
parent | 0dd2391f9fb4dd464fac8c144a45cf24189079fa (diff) | |
download | ComputeLibrary-16934a511ccd37a28000a9fabb3e6e5fc6f51ec9.tar.gz |
COMPMID-1227 Implementing Space to Batch on OpenCL
Change-Id: I6fd83d6584c56a4fd2470948f1987e23237c16d3
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/145577
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Tested-by: bsgcomp <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core/utils')
-rw-r--r-- | arm_compute/core/utils/misc/ShapeCalculator.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h index cb04182c21..806149f83f 100644 --- a/arm_compute/core/utils/misc/ShapeCalculator.h +++ b/arm_compute/core/utils/misc/ShapeCalculator.h @@ -557,6 +557,16 @@ inline TensorShape compute_split_shape(const ITensorInfo *input, unsigned int ax return out_shape; } +inline TensorShape compute_space_to_batch_shape(const ITensorInfo *input, const int block_x, const int block_y, const Size2D &padding_left, const Size2D &padding_right) +{ + TensorShape output_shape{ input->tensor_shape() }; + output_shape.set(0, input->tensor_shape()[0] * block_x + padding_left.x() + padding_right.x()); + output_shape.set(1, input->tensor_shape()[1] * block_y + padding_left.y() + padding_right.y()); + output_shape.set(3, input->tensor_shape()[3] / (block_x * block_y)); + + return output_shape; +} + template <typename T> inline TensorShape extract_shape(T *data) { |