diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/helpers/Utils.cpp | 5 | ||||
-rw-r--r-- | src/core/helpers/Utils.h | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/core/helpers/Utils.cpp b/src/core/helpers/Utils.cpp index 6ca29d180d..f8895d8a3c 100644 --- a/src/core/helpers/Utils.cpp +++ b/src/core/helpers/Utils.cpp @@ -25,6 +25,11 @@ namespace arm_compute { +bool has_holes(const ITensorInfo &info) +{ + return has_holes(info, info.num_dimensions() - 1); +} + bool has_holes(const ITensorInfo &info, size_t dimension) { const auto &shape = info.tensor_shape(); diff --git a/src/core/helpers/Utils.h b/src/core/helpers/Utils.h index 2e7224c55b..a17a78f7ee 100644 --- a/src/core/helpers/Utils.h +++ b/src/core/helpers/Utils.h @@ -95,6 +95,18 @@ inline unsigned int get_next_power_two(unsigned int x) /** Check if the tensor has any holes. * + * A hole is defined as any gap in the tensor between two consecutive values. This can be a result of extending + * the paddings or manipulating the strides of the tensor + * + * @param[in] info Tensor info object defining the shape of the input tensor. + * + * @note This function checks for holes in all dimensions. + * + */ +bool has_holes(const ITensorInfo &info); + +/** Check if the tensor has any holes. + * * @param[in] info Tensor info object defining the shape of the input tensor. * @param[in] dimension Highest dimension to check. * |