From ac4e873dad6aa6291fc36aff62047a896db04f6a Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Wed, 5 Jul 2017 17:02:25 +0100 Subject: COMPMID-417: Port DepthConcatenate to QS8/QS16 for NEON/CL. Change-Id: I3dddae63043c7aa18d908a4fc8abacf3c64f98ca Reviewed-on: http://mpd-gerrit.cambridge.arm.com/80081 Tested-by: Kaizen Reviewed-by: Steven Niu --- tests/validation/Helpers.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tests/validation/Helpers.h') diff --git a/tests/validation/Helpers.h b/tests/validation/Helpers.h index a551da731e..cae1976bd6 100644 --- a/tests/validation/Helpers.h +++ b/tests/validation/Helpers.h @@ -172,6 +172,34 @@ inline void fill_mask_from_pattern(uint8_t *mask, int cols, int rows, MatrixPatt } } +/** Calculate output tensor shape give a vector of input tensor to concatenate + * + * @param[in] input_shapes Shapes of the tensors to concatenate across depth. + * + * @return The shape of output concatenated tensor. + */ +inline TensorShape calculate_depth_concatenate_shape(std::vector input_shapes) +{ + TensorShape out_shape = input_shapes.at(0); + + unsigned int max_x = 0; + unsigned int max_y = 0; + unsigned int depth = 0; + + for(auto const &shape : input_shapes) + { + max_x = std::max(shape.x(), max_x); + max_y = std::max(shape.y(), max_y); + depth += shape.z(); + } + + out_shape.set(0, max_x); + out_shape.set(1, max_y); + out_shape.set(2, depth); + + return out_shape; +} + /** Create a vector of random ROIs. * * @param[in] shape The shape of the input tensor. -- cgit v1.2.1