From 4d8ff86bd2e853b84a28acd2ece1836d28523f9e Mon Sep 17 00:00:00 2001 From: barnasm1 Date: Mon, 4 Nov 2024 10:25:47 +0100 Subject: [PATCH] Add squeeze v15 op spec (#26989) ### Details: - Add squeeze v15 op spec ### Tickets: - [*154021*](https://jira.devtools.intel.com/browse/CVS-154021) --- .../available-opsets/opset15.rst | 2 +- .../operation-sets/operation-specs.rst | 1 + .../operation-specs/shape/squeeze-15.rst | 174 ++++++++++++++++++ 3 files changed, 176 insertions(+), 1 deletion(-) create mode 100644 docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/shape/squeeze-15.rst diff --git a/docs/articles_en/documentation/openvino-ir-format/operation-sets/available-opsets/opset15.rst b/docs/articles_en/documentation/openvino-ir-format/operation-sets/available-opsets/opset15.rst index b32d7b71580177..1dbb0a9101bb99 100644 --- a/docs/articles_en/documentation/openvino-ir-format/operation-sets/available-opsets/opset15.rst +++ b/docs/articles_en/documentation/openvino-ir-format/operation-sets/available-opsets/opset15.rst @@ -198,7 +198,7 @@ Table of Contents * :doc:`Split <../operation-specs/movement/split-1>` * :doc:`Sqrt <../operation-specs/arithmetic/sqrt-1>` * :doc:`SquaredDifference <../operation-specs/arithmetic/squared-difference-1>` -* :doc:`Squeeze <../operation-specs/shape/squeeze-1>` +* :doc:`Squeeze <../operation-specs/shape/squeeze-15>` * :doc:`STFT <../operation-specs/signals/stft-15>` * :doc:`StridedSlice <../operation-specs/movement/strided-slice-1>` * :doc:`StringTensorPack <../operation-specs/type/string-tensor-pack-15>` diff --git a/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs.rst b/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs.rst index 8eccea47c31dd0..9f7badf1a8d06a 100644 --- a/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs.rst +++ b/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs.rst @@ -226,6 +226,7 @@ Operation Specifications Sqrt-1 SquaredDifference-1 Squeeze-1 + Squeeze-15 STFT-15 StridedSlice-1 StringTensorPack-15 diff --git a/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/shape/squeeze-15.rst b/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/shape/squeeze-15.rst new file mode 100644 index 00000000000000..1e112dce118e26 --- /dev/null +++ b/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/shape/squeeze-15.rst @@ -0,0 +1,174 @@ +Squeeze +======= + + +.. meta:: + :description: Learn about Squeeze-15 - a shape manipulation operation, which + can be performed on one required and one optional input tensor. + +**Versioned name**: *Squeeze-15* + +**Category**: *Shape manipulation* + +**Short description**: *Squeeze* removes dimensions equal to 1 from the first input tensor. + +**Detailed description**: *Squeeze* can be used with or without the second input tensor. + +* If only the first input is provided, every dimension that is equal to 1 will be removed from it. +* With the second input provided, each value is an index of a dimension from the first tensor that is to be removed. Specified dimension should be equal to 1, otherwise it will be ignored and copied as is. + Dimension indices can be specified directly, or by negative indices (counting dimensions from the end). + +.. note:: + + - If index of the dimension to squeeze is provided as a constant input and it points to a dynamic dimension that might be `1`, and the *allow_axis_skip* attribute is ``false``, then the dimension is considered as squeezable. Therefore the rank of the output shape will be reduced, but not dynamic. If dynamic rank is expected for such case, *allow_axis_skip* attribute need to be set to ``true``. + - If the input with indices is empty or not provided, dynamic dimension compatible with `1` leads to dynamic rank of the output shape. + + +**Attributes**: + +* *allow_axis_skip* + + * **Description**: If true, shape inference results in a dynamic rank if selected axis has value 1 in its dimension range. + * **Range of values**: ``false`` or ``true`` + * **Type**: ``boolean`` + * **Required**: *no* + * **Default value**: ``false`` + +**Inputs**: + +* **1**: Multidimensional input tensor of type *T*. **Required.** + +* **2**: Scalar or 1D tensor of type *T_INT* with indices of dimensions to squeeze. Values could be negative (have to be from range ``[-R, R-1]``, where ``R`` is the rank of the first input). **Optional.** + +**Outputs**: + +* **1**: Tensor with squeezed values of type *T*. + +**Types** + +* *T*: any numeric type. + +* *T_INT*: any supported integer type. + +**Example** + +*Example 1: squeeze 4D tensor to a 2D tensor* + +.. code-block:: xml + :force: + + + + + + 1 + 3 + 1 + 2 + + + + + 2 + + + + + 3 + 2 + + + + +*Example 2: squeeze 1D tensor with 1 element to a 0D tensor (constant)* + +.. code-block:: xml + :force: + + + + + + 1 + + + + + 1 + + + + + + + + +*Example 3: squeeze 1D tensor with 1 dynamic shape element to a fully dynamic shape* + +.. code-block:: xml + :force: + + + + + + -1 + + + + + 1 + + + + + + + +*Example 4: squeeze 2D tensor with dynamic and static shape elements to a static shape output, according to the opset1 rules* + +.. code-block:: xml + :force: + + + + + + 2 + -1 + + + + + 1 + + + + + 2 + + + + +*Example 5: squeeze 2D tensor with dynamic and static shape elements to a dynamic shape output, according to the opset15 rules* + +.. code-block:: xml + :force: + + + + + + 2 + -1 + + + + + 1 + + + + + +