From d17a677a70d477ae508c084148ba6974fc38477d Mon Sep 17 00:00:00 2001 From: Isabella Gottardi Date: Tue, 27 Feb 2018 17:41:55 +0000 Subject: COMPMID-979: Add NHWC data layout to the tensor's metadata Change-Id: I89bdab7dc63a437eb7d60c0ae652c53c3875e503 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/122524 Tested-by: Jenkins Reviewed-by: Anthony Barbier Reviewed-by: Pablo Tello --- arm_compute/core/Helpers.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'arm_compute/core/Helpers.h') diff --git a/arm_compute/core/Helpers.h b/arm_compute/core/Helpers.h index 63fad1dcea..c91299f218 100644 --- a/arm_compute/core/Helpers.h +++ b/arm_compute/core/Helpers.h @@ -588,6 +588,16 @@ bool set_format_if_unknown(ITensorInfo &info, Format format); */ bool set_data_type_if_unknown(ITensorInfo &info, DataType data_type); +/* Set the data layout to the specified value if + * the current data layout is unknown. + * + * @param[in,out] info Tensor info used to check and assign. + * @param[in] data_layout New data layout. + * + * @return True if the data type has been changed. + */ +bool set_data_layout_if_unknown(ITensorInfo &info, DataLayout data_layout); + /* Set the fixed point position to the specified value if * the current fixed point position is 0 and the data type is QS8 or QS16 * @@ -637,6 +647,15 @@ inline Coordinates index2coords(const TensorShape &shape, int index); * @return linead index */ inline int coords2index(const TensorShape &shape, const Coordinates &coord); + +/* Get the index of the given dimension. + * + * @param[in] info Tensor info used to check and assign. + * @param[in] data_layout New data layout. + * + * @return The int conversion of the requested data layout index. + */ +inline int get_data_layout_dimension_index(const ITensorInfo &info, const DataLayoutDimension data_layout_dimension); } // namespace arm_compute #include "arm_compute/core/Helpers.inl" -- cgit v1.2.1