diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-04-12 13:15:58 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-04-15 16:52:22 +0000 |
commit | 9e4824c909b14dbaf7106e9527b0ffa22ef09bdc (patch) | |
tree | b1cc8f6a8b275a7e227e305f1b02870d5e0f30ec /src/graph/Utils.cpp | |
parent | d66094e37ecd747e85f30130e1a678bdbaf30788 (diff) | |
download | ComputeLibrary-9e4824c909b14dbaf7106e9527b0ffa22ef09bdc.tar.gz |
COMPMID-2111: ConcatenateLayer API should accept an index instead of an enum
Alters the concatenate layer to be layout agnostic and accept an index
as thec concatenation axis instead of an typed layout dependent
enumeration.
Change-Id: I0eaaf919f66a1ba1b09bbfb47c171fc1d4045530
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Reviewed-on: https://review.mlplatform.org/c/994
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/graph/Utils.cpp')
-rw-r--r-- | src/graph/Utils.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/graph/Utils.cpp b/src/graph/Utils.cpp index 71a6fc582b..4c34dd85a5 100644 --- a/src/graph/Utils.cpp +++ b/src/graph/Utils.cpp @@ -119,12 +119,12 @@ void setup_requested_backend_context(GraphContext &ctx, Target target) size_t get_dimension_size(const TensorDescriptor &descriptor, const DataLayoutDimension data_layout_dimension) { ARM_COMPUTE_ERROR_ON_MSG(descriptor.layout == DataLayout::UNKNOWN, "Cannot retrieve the dimension index for an unknown layout!"); - return descriptor.shape[get_dimension_idx(descriptor, data_layout_dimension)]; + return descriptor.shape[get_dimension_idx(descriptor.layout, data_layout_dimension)]; } -size_t get_dimension_idx(const TensorDescriptor &descriptor, const DataLayoutDimension data_layout_dimension) +size_t get_dimension_idx(DataLayout data_layout, const DataLayoutDimension data_layout_dimension) { - ARM_COMPUTE_ERROR_ON_MSG(descriptor.layout == DataLayout::UNKNOWN, "Cannot retrieve the dimension index for an unknown layout!"); + ARM_COMPUTE_ERROR_ON_MSG(data_layout == DataLayout::UNKNOWN, "Cannot retrieve the dimension index for an unknown layout!"); /* Return the index based on the data layout * [N C H W] @@ -134,13 +134,13 @@ size_t get_dimension_idx(const TensorDescriptor &descriptor, const DataLayoutDim switch(data_layout_dimension) { case DataLayoutDimension::CHANNEL: - return (descriptor.layout == DataLayout::NCHW) ? 2 : 0; + return (data_layout == DataLayout::NCHW) ? 2 : 0; break; case DataLayoutDimension::HEIGHT: - return (descriptor.layout == DataLayout::NCHW) ? 1 : 2; + return (data_layout == DataLayout::NCHW) ? 1 : 2; break; case DataLayoutDimension::WIDTH: - return (descriptor.layout == DataLayout::NCHW) ? 0 : 1; + return (data_layout == DataLayout::NCHW) ? 0 : 1; break; case DataLayoutDimension::BATCHES: return 3; |