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 --- src/graph/nodes/ConcatenateLayerNode.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/graph') diff --git a/src/graph/nodes/ConcatenateLayerNode.cpp b/src/graph/nodes/ConcatenateLayerNode.cpp index 48da8b6e9e..ff515c4427 100644 --- a/src/graph/nodes/ConcatenateLayerNode.cpp +++ b/src/graph/nodes/ConcatenateLayerNode.cpp @@ -68,6 +68,7 @@ TensorDescriptor ConcatenateLayerNode::compute_output_descriptor(const std::vect TensorDescriptor output_descriptor = input_descriptors[0]; const int axis_idx = get_dimension_idx(output_descriptor.layout, axis); + ARM_COMPUTE_ERROR_ON_MSG(axis_idx > 2, "Unsupported concatenation axis!"); // Extract shapes std::vector shapes; @@ -76,18 +77,7 @@ TensorDescriptor ConcatenateLayerNode::compute_output_descriptor(const std::vect shapes.emplace_back(&input_descriptor.shape); } - if(axis_idx < 2) - { - output_descriptor.shape = arm_compute::misc::shape_calculator::calculate_concatenate_shape(shapes, axis_idx); - } - else if(axis_idx == 2) - { - output_descriptor.shape = arm_compute::misc::shape_calculator::calculate_depth_concatenate_shape(shapes); - } - else - { - ARM_COMPUTE_ERROR("Unsupported concatenation axis!"); - } + output_descriptor.shape = arm_compute::misc::shape_calculator::calculate_concatenate_shape(shapes, axis_idx); return output_descriptor; } -- cgit v1.2.1