aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/utils
diff options
context:
space:
mode:
authorManuel Bottini <manuel.bottini@arm.com>2018-11-21 11:53:04 +0000
committerGeorgios Pinitas <georgios.pinitas@arm.com>2019-01-07 10:54:47 +0000
commit8529bd68d8a979874b8c53c0e26af411aae058f5 (patch)
treeb20826ece1b05b13ccc8b9fd5ee2c7ced1e498f9 /arm_compute/core/utils
parent1bf5e289ec08c6eb507c079fd16c877559b45684 (diff)
downloadComputeLibrary-8529bd68d8a979874b8c53c0e26af411aae058f5.tar.gz
COMPMID-1727 - CL: Implement Gather
Change-Id: I3d859da09a4de1019bb8c2046725eab942247927 Reviewed-on: https://review.mlplatform.org/386 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'arm_compute/core/utils')
-rw-r--r--arm_compute/core/utils/misc/ShapeCalculator.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h
index 4756ff4f97..ba0d8e254d 100644
--- a/arm_compute/core/utils/misc/ShapeCalculator.h
+++ b/arm_compute/core/utils/misc/ShapeCalculator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -874,6 +874,18 @@ inline TensorShape compute_stack_shape(const ITensorInfo &a, unsigned int axis,
}
return shape_out;
}
+
+inline TensorShape compute_gather_shape(const TensorShape &input_shape, const TensorShape &indices_shape, uint32_t actual_axis)
+{
+ ARM_COMPUTE_ERROR_ON(indices_shape.num_dimensions() > 1);
+ ARM_COMPUTE_ERROR_ON(input_shape.num_dimensions() > 4);
+ ARM_COMPUTE_ERROR_ON(actual_axis >= input_shape.num_dimensions());
+
+ TensorShape output_shape = input_shape;
+ output_shape[actual_axis] = indices_shape[0];
+
+ return output_shape;
+}
} // namespace shape_calculator
} // namespace misc
} // namespace arm_compute