diff options
Diffstat (limited to 'arm_compute/core')
-rw-r--r-- | arm_compute/core/CL/kernels/CLWinogradInputTransformKernel.h | 2 | ||||
-rw-r--r-- | arm_compute/core/utils/misc/ShapeCalculator.h | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/arm_compute/core/CL/kernels/CLWinogradInputTransformKernel.h b/arm_compute/core/CL/kernels/CLWinogradInputTransformKernel.h index b92ff2f60c..58e8291161 100644 --- a/arm_compute/core/CL/kernels/CLWinogradInputTransformKernel.h +++ b/arm_compute/core/CL/kernels/CLWinogradInputTransformKernel.h @@ -49,6 +49,7 @@ public: * @note Winograd input transform supports the following configurations: * F(output tile, kernel size):F(2x2, 3x3), F(4x4, 3x3), F(4x4, 5x5) * Strides: only unit strides + * Data Layout: NCHW for all configurations, NHWC for F(4x4, 3x3) * * @param[in] input The input tensor to transform. Data types supported: F32 * @param[in] output The output tensor. The shape for this tensor can be calculated using the utility function @p compute_winograd_input_transform_shape. Data types supported: Same as @p input @@ -60,6 +61,7 @@ public: * @note Winograd input transform supports the following configurations: * F(output tile, kernel size):F(2x2, 3x3), F(4x4, 3x3), F(4x4, 5x5) * Strides: only unit strides + * Data Layout: NCHW for all configurations, NHWC for F(4x4, 3x3) * * @param[in] input The input tensor to transform. Data types supported: F32 * @param[in] output The output tensor. The shape for this tensor can be calculated using the utility function @p compute_winograd_input_transform_shape. Data types supported: Same as @p input diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h index 9666702749..f64cf9d6ae 100644 --- a/arm_compute/core/utils/misc/ShapeCalculator.h +++ b/arm_compute/core/utils/misc/ShapeCalculator.h @@ -250,11 +250,15 @@ inline TensorShape compute_winograd_input_transform_shape(const ITensorInfo &inp const Size2D output_tile_size = winograd_info.output_tile_size; const Size2D input_tile_size = Size2D(output_tile_size.width + kernel_size.width - 1, output_tile_size.height + kernel_size.height - 1); + const size_t idx_w = get_data_layout_dimension_index(input.data_layout(), DataLayoutDimension::WIDTH); + const size_t idx_h = get_data_layout_dimension_index(input.data_layout(), DataLayoutDimension::HEIGHT); + const size_t idx_c = get_data_layout_dimension_index(input.data_layout(), DataLayoutDimension::CHANNEL); + // Compute height - const unsigned int num_tiles_x = std::ceil((input.tensor_shape().x() - (kernel_size.width - 1) + conv_info.pad_left() + conv_info.pad_right()) / static_cast<float>(output_tile_size.width)); - const unsigned int num_tiles_y = std::ceil((input.tensor_shape().y() - (kernel_size.height - 1) + conv_info.pad_top() + conv_info.pad_bottom()) / static_cast<float>(output_tile_size.height)); + const unsigned int num_tiles_x = std::ceil((input.tensor_shape()[idx_w] - (kernel_size.width - 1) + conv_info.pad_left() + conv_info.pad_right()) / static_cast<float>(output_tile_size.width)); + const unsigned int num_tiles_y = std::ceil((input.tensor_shape()[idx_h] - (kernel_size.height - 1) + conv_info.pad_top() + conv_info.pad_bottom()) / static_cast<float>(output_tile_size.height)); - const unsigned int width = input.tensor_shape()[get_data_layout_dimension_index(input.data_layout(), DataLayoutDimension::CHANNEL)]; + const unsigned int width = input.tensor_shape()[idx_c]; const unsigned int height = num_tiles_x * num_tiles_y; const unsigned int depth = input_tile_size.area(); |