diff options
author | Michalis Spyrou <michalis.spyrou@arm.com> | 2019-04-05 17:18:36 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-04-16 16:02:13 +0000 |
commit | a9c4472188abef421adb589e2a6fef52727d465f (patch) | |
tree | f8f6540b05049074030c32332b5427e826cc58ea /tests/validation/Helpers.cpp | |
parent | 2ec6c1eb6ee77b79e8ab6b97b8cd70bcc4c5589d (diff) | |
download | ComputeLibrary-a9c4472188abef421adb589e2a6fef52727d465f.tar.gz |
COMPMID-2051 Refactor shape_calculator::calculate_concatenate_shape
Change-Id: Ibf316718d11fa975d75f226925747b21c4efd127
Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com>
Reviewed-on: https://review.mlplatform.org/c/974
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Diffstat (limited to 'tests/validation/Helpers.cpp')
-rw-r--r-- | tests/validation/Helpers.cpp | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/tests/validation/Helpers.cpp b/tests/validation/Helpers.cpp index e9612f2223..504dbfd3a4 100644 --- a/tests/validation/Helpers.cpp +++ b/tests/validation/Helpers.cpp @@ -74,46 +74,6 @@ void fill_mask_from_pattern(uint8_t *mask, int cols, int rows, MatrixPattern pat } } -TensorShape calculate_depth_concatenate_shape(const std::vector<TensorShape> &input_shapes) -{ - ARM_COMPUTE_ERROR_ON(input_shapes.empty()); - - TensorShape out_shape = input_shapes[0]; - - size_t max_x = 0; - size_t max_y = 0; - size_t depth = 0; - - for(const auto &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; -} - -TensorShape calculate_concatenate_shape(const std::vector<TensorShape> &input_shapes, size_t axis) -{ - ARM_COMPUTE_ERROR_ON(input_shapes.empty()); - TensorShape out_shape = input_shapes[0]; - ARM_COMPUTE_ERROR_ON(axis >= out_shape.num_dimensions()); - - const int new_size = std::accumulate(input_shapes.begin(), input_shapes.end(), 0, [&](int sum, const TensorShape & shape) - { - ARM_COMPUTE_ERROR_ON(axis >= shape.num_dimensions()); - return sum + shape[axis]; - }); - out_shape.set(axis, new_size); - - return out_shape; -} - HarrisCornersParameters harris_corners_parameters() { HarrisCornersParameters params; |