From a9c4472188abef421adb589e2a6fef52727d465f Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Fri, 5 Apr 2019 17:18:36 +0100 Subject: COMPMID-2051 Refactor shape_calculator::calculate_concatenate_shape Change-Id: Ibf316718d11fa975d75f226925747b21c4efd127 Signed-off-by: Michalis Spyrou Reviewed-on: https://review.mlplatform.org/c/974 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio --- tests/validation/fixtures/ConcatenateLayerFixture.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tests/validation/fixtures/ConcatenateLayerFixture.h') diff --git a/tests/validation/fixtures/ConcatenateLayerFixture.h b/tests/validation/fixtures/ConcatenateLayerFixture.h index 39d4f9f95d..d1eed63d41 100644 --- a/tests/validation/fixtures/ConcatenateLayerFixture.h +++ b/tests/validation/fixtures/ConcatenateLayerFixture.h @@ -73,7 +73,7 @@ public: // Generate more shapes based on the input for(auto &s : shapes) { - // Randomly change the first dimension + // Randomly change the dimension if(mutate_dis(gen)) { // Decrease the dimension by a small percentage. Don't increase @@ -144,18 +144,20 @@ protected: return dst; } - SimpleTensor compute_reference(const std::vector &shapes, const std::vector &qinfo, DataType data_type, unsigned int axis) + SimpleTensor compute_reference(std::vector &shapes, const std::vector &qinfo, DataType data_type, unsigned int axis) { std::vector> srcs; + std::vector src_ptrs; // Create and fill tensors for(size_t j = 0; j < shapes.size(); ++j) { srcs.emplace_back(shapes[j], data_type, 1, qinfo[j]); fill(srcs.back(), j); + src_ptrs.emplace_back(&shapes[j]); } - const TensorShape dst_shape = calculate_concatenate_shape(shapes, axis); + const TensorShape dst_shape = misc::shape_calculator::calculate_concatenate_shape(src_ptrs, axis); SimpleTensor dst{ dst_shape, data_type, 1, qinfo[shapes.size()] }; return reference::concatenate_layer(srcs, dst, axis); } -- cgit v1.2.1