diff options
Diffstat (limited to 'arm_compute')
-rw-r--r-- | arm_compute/core/CL/kernels/CLCol2ImKernel.h | 6 | ||||
-rw-r--r-- | arm_compute/core/utils/misc/ShapeCalculator.h | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/arm_compute/core/CL/kernels/CLCol2ImKernel.h b/arm_compute/core/CL/kernels/CLCol2ImKernel.h index 2a18ae08c8..948b412ccd 100644 --- a/arm_compute/core/CL/kernels/CLCol2ImKernel.h +++ b/arm_compute/core/CL/kernels/CLCol2ImKernel.h @@ -71,7 +71,7 @@ public: * @param[in] convolved_dims Output convolved dimensions. * @param[in] num_groups (Optional) Number of groups when performing a grouped convolution */ - void configure(const ICLTensor *input, ICLTensor *output, std::pair<unsigned int, unsigned int> convolved_dims, unsigned int num_groups = 1); + void configure(const ICLTensor *input, ICLTensor *output, const Size2D &convolved_dims, unsigned int num_groups = 1); /** Static function to check if given info will lead to a valid configuration of @ref CLCol2ImKernel * * @param[in] input The input tensor to convert. Data types supported: QASYMM8/F16/F32 @@ -82,7 +82,7 @@ public: * * @return a status */ - static Status validate(const ITensorInfo *input, const ITensorInfo *output, std::pair<unsigned int, unsigned int> convolved_dims, unsigned int num_groups = 1); + static Status validate(const ITensorInfo *input, const ITensorInfo *output, const Size2D &convolved_dims, unsigned int num_groups = 1); // Inherited methods overridden: void run(const Window &window, cl::CommandQueue &queue) override; @@ -90,7 +90,7 @@ public: public: const ICLTensor *_input; ICLTensor *_output; - std::pair<unsigned int, unsigned int> _convolved_dims; + Size2D _convolved_dims; }; } // namespace arm_compute #endif /*__ARM_COMPUTE_CLCOL2IMKERNEL_H__ */ diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h index c40e7119b2..09f558d8b0 100644 --- a/arm_compute/core/utils/misc/ShapeCalculator.h +++ b/arm_compute/core/utils/misc/ShapeCalculator.h @@ -141,18 +141,18 @@ inline TensorShape compute_reductionB_shape(const ITensorInfo &a) return shape_vector_sum_row; } -inline TensorShape compute_col2im_shape(const ITensorInfo &input, std::pair<unsigned int, unsigned int> convolved_dims, unsigned int num_groups = 1) +inline TensorShape compute_col2im_shape(const ITensorInfo &input, const Size2D &convolved_dims, bool batch_size_on_z, unsigned int num_groups = 1) { ARM_COMPUTE_ERROR_ON(num_groups == 0); - ARM_COMPUTE_ERROR_ON(input.tensor_shape()[1] != (convolved_dims.first * convolved_dims.second)); + ARM_COMPUTE_ERROR_ON(input.tensor_shape()[1] != (convolved_dims.area())); ARM_COMPUTE_ERROR_ON((num_groups > 1) && input.tensor_shape()[2] != num_groups); TensorShape col2im_shape{ input.tensor_shape() }; - col2im_shape.set(0, convolved_dims.first); - col2im_shape.set(1, convolved_dims.second); + col2im_shape.set(0, convolved_dims.width); + col2im_shape.set(1, convolved_dims.height); col2im_shape.set(2, input.tensor_shape()[0] * num_groups); - const unsigned int batch_idx = (num_groups == 1) ? 2 : 3; + const unsigned int batch_idx = (batch_size_on_z && num_groups == 1) ? 2 : 3; col2im_shape.set(3, input.tensor_shape()[batch_idx]); return col2im_shape; |