diff options
Diffstat (limited to 'arm_compute/core/TensorShape.h')
-rw-r--r-- | arm_compute/core/TensorShape.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arm_compute/core/TensorShape.h b/arm_compute/core/TensorShape.h index 0c3d9414e1..0340e1a644 100644 --- a/arm_compute/core/TensorShape.h +++ b/arm_compute/core/TensorShape.h @@ -136,6 +136,20 @@ public: // Make sure all empty dimensions are filled with 1 std::fill(_id.begin() + _num_dimensions, _id.end(), 1); } + /** Shifts right the tensor shape increasing its dimensions + * + * @param[in] step Rotation step + */ + void shift_right(size_t step) + { + ARM_COMPUTE_ERROR_ON(step > TensorShape::num_max_dimensions - num_dimensions()); + + std::rotate(begin(), begin() + TensorShape::num_max_dimensions - step, end()); + _num_dimensions += step; + + // Correct number dimensions to ignore trailing dimensions of size 1 + apply_dimension_correction(); + } /** Return a copy with collapsed dimensions starting from a given point. * |