aboutsummaryrefslogtreecommitdiff
path: root/src/graph
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2018-12-10 18:45:35 +0000
committerPablo Marquez <pablo.tello@arm.com>2018-12-14 15:27:18 +0000
commitb4af2c6738614850aaca3754904f0e8e3b17f0b2 (patch)
treea2d234a99d0599c325311c73a4e4f2df019eb3ee /src/graph
parentbf9731edfa0439cad4d70efc3065e71e199c62b8 (diff)
downloadComputeLibrary-b4af2c6738614850aaca3754904f0e8e3b17f0b2.tar.gz
COMPMID-1710: Fixes in StrideSlice calculations.
Change-Id: I66eb922f1ff15142de278bf4439a61c979f98ba7 Reviewed-on: https://review.mlplatform.org/382 Reviewed-by: Matthew Bentham <matthew.bentham@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Pablo Marquez <pablo.tello@arm.com>
Diffstat (limited to 'src/graph')
-rw-r--r--src/graph/nodes/SliceLayerNode.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/graph/nodes/SliceLayerNode.cpp b/src/graph/nodes/SliceLayerNode.cpp
index 3a29e4c9ad..bfc009d3eb 100644
--- a/src/graph/nodes/SliceLayerNode.cpp
+++ b/src/graph/nodes/SliceLayerNode.cpp
@@ -24,7 +24,7 @@
#include "arm_compute/graph/nodes/SliceLayerNode.h"
#include "arm_compute/core/Utils.h"
-#include "arm_compute/core/utils/helpers/tensor_transform.h"
+#include "arm_compute/core/utils/misc/ShapeCalculator.h"
#include "arm_compute/graph/Graph.h"
#include "arm_compute/graph/INodeVisitor.h"
@@ -52,16 +52,12 @@ Coordinates SliceLayerNode::ends() const
TensorDescriptor SliceLayerNode::compute_output_descriptor(const TensorDescriptor &input_descriptor,
const Coordinates &starts, const Coordinates &ends)
{
- // Get absolute end coordinates
- const Coordinates ends_abs = arm_compute::helpers::tensor_transform::slice_absolute_end_coords(input_descriptor.shape, ends);
+ using namespace arm_compute::helpers::tensor_transform;
- TensorDescriptor output_descriptor = input_descriptor;
- for(unsigned int i = 0; i < starts.num_dimensions(); ++i)
- {
- output_descriptor.shape.set(i, ends_abs[i] - starts[i]);
- }
+ TensorDescriptor output_desc = input_descriptor;
+ output_desc.shape = arm_compute::misc::shape_calculator::compute_slice_shape(input_descriptor.shape, starts, ends);
- return output_descriptor;
+ return output_desc;
}
bool SliceLayerNode::forward_descriptors()