aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/utils
diff options
context:
space:
mode:
authorAbe Mbise <abe.mbise@arm.com>2018-05-31 16:48:41 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:54:54 +0000
commit7784c837afd5844fb6dc4d166ff253d983abfd2d (patch)
tree3bc770240de148d565aa828e8f3471c354ac3837 /arm_compute/core/utils
parentb03f7c5c780fe2df23eb8c5c1b4b1d65bd7f0339 (diff)
downloadComputeLibrary-7784c837afd5844fb6dc4d166ff253d983abfd2d.tar.gz
COMPMID-1167: Validation for NEDepthwiseConvolutionLayer
Change-Id: I9689e1a0627dc015dd2ce98417e4c97bb55581bb Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/131327 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core/utils')
-rw-r--r--arm_compute/core/utils/misc/ShapeCalculator.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h
index 221387649f..9bf6b046b4 100644
--- a/arm_compute/core/utils/misc/ShapeCalculator.h
+++ b/arm_compute/core/utils/misc/ShapeCalculator.h
@@ -36,6 +36,19 @@ namespace misc
{
namespace shape_calculator
{
+inline TensorShape compute_vector_to_tensor_output_shape(const TensorShape &input, size_t conv_w, size_t conv_h, const DataLayout &data_layout)
+{
+ const size_t idx_w = get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH);
+ const size_t idx_h = get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT);
+ const size_t idx_c = get_data_layout_dimension_index(data_layout, DataLayoutDimension::CHANNEL);
+
+ TensorShape output_shape(input);
+ output_shape.set(idx_w, conv_w);
+ output_shape.set(idx_h, conv_h);
+ output_shape.set(idx_c, input.x() / (conv_w * conv_h));
+
+ return output_shape;
+}
inline TensorShape compute_permutation_output_shape(const ITensorInfo &input, const PermutationVector &perm)
{
TensorShape output_shape = input.tensor_shape();