From 1590cbee229b8688cace6639316c56fffa15765e Mon Sep 17 00:00:00 2001 From: Michal Barnas Date: Thu, 10 Oct 2024 08:33:08 +0000 Subject: [PATCH 1/9] add squeeze v15 op spec --- .../operation-specs/shape/squeeze-15.rst | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) 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/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..0b5757fafaa761 --- /dev/null +++ b/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/shape/squeeze-15.rst @@ -0,0 +1,104 @@ +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:: + + Behavior before 2024.3 OpenVINO release: Error is raised when dimension to squeeze is not compatible with 1. + +.. 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`, then the dimension is considered as squeezable. Therefore the rank of the output shape will be reduced, but not dynamic. + - 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**: Shape inference result dynamic rank if selected axis has value 1 in range of its dynamic. + * **Range of values**: ``false`` or ``true`` + * **Type**: ``boolean`` + * **Required**: *no* + +**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 + + + + + + + From 0f44d06a8560b7e8170bd6711edcb9bcd61bad80 Mon Sep 17 00:00:00 2001 From: Michal Barnas Date: Tue, 15 Oct 2024 13:21:47 +0000 Subject: [PATCH 2/9] format line --- .../operation-sets/operation-specs/shape/squeeze-15.rst | 1 + 1 file changed, 1 insertion(+) 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 index 0b5757fafaa761..5adfc9e8692863 100644 --- 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 @@ -29,6 +29,7 @@ Squeeze **Attributes**: + * *allow_axis_skip* * **Description**: Shape inference result dynamic rank if selected axis has value 1 in range of its dynamic. From 6b3aa5187c9e27f39d858c7f19ab21e429659ca7 Mon Sep 17 00:00:00 2001 From: Michal Barnas Date: Tue, 15 Oct 2024 14:02:18 +0000 Subject: [PATCH 3/9] review suggestions --- .../operation-sets/operation-specs/shape/squeeze-15.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 index 5adfc9e8692863..b79b29aa306487 100644 --- 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 @@ -18,10 +18,6 @@ Squeeze * 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:: - - Behavior before 2024.3 OpenVINO release: Error is raised when dimension to squeeze is not compatible with 1. - .. 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`, then the dimension is considered as squeezable. Therefore the rank of the output shape will be reduced, but not dynamic. @@ -36,6 +32,7 @@ Squeeze * **Range of values**: ``false`` or ``true`` * **Type**: ``boolean`` * **Required**: *no* + * **Default value**: ``false`` **Inputs**: From 8369fbe666ccce5a87fa6ea75d3828b06c498eef Mon Sep 17 00:00:00 2001 From: Michal Barnas Date: Wed, 16 Oct 2024 09:07:49 +0000 Subject: [PATCH 4/9] add example --- .../operation-specs/shape/squeeze-15.rst | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) 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 index b79b29aa306487..5d4e1abeafec76 100644 --- 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 @@ -57,7 +57,8 @@ Squeeze .. code-block:: xml :force: - + + 1 @@ -84,7 +85,8 @@ Squeeze .. code-block:: xml :force: - + + 1 @@ -100,3 +102,25 @@ Squeeze + +*Example 3: squeeze 1D tensor with 1 dynamic shape element to a fully dynamic shape* + +.. code-block:: xml + :force: + + + + + + -1 + + + + + 1 + + + + + + From 5b7950ac634ecd7aa40501ccfae3fe19b33f91a7 Mon Sep 17 00:00:00 2001 From: Michal Barnas Date: Wed, 16 Oct 2024 09:28:33 +0000 Subject: [PATCH 5/9] example 4, 5 --- .../operation-specs/shape/squeeze-15.rst | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) 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 index 5d4e1abeafec76..628a065b047f5c 100644 --- 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 @@ -124,3 +124,51 @@ Squeeze + +*Example 4: squeeze 2D tensor with 1 dynamic and one static shape element to a static shape output, according to the opset1 rules* + +.. code-block:: xml + :force: + + + + + + 2 + -1 + + + + + 1 + + + + + 2 + + + + +*Example 5: squeeze 2D tensor with 1 dynamic and one static shape element to a static shape output, according to the opset15 rules* + +.. code-block:: xml + :force: + + + + + + 2 + -1 + + + + + 1 + + + + + + From 5f5302f22c55d37cf849bc10861a6131210fe26e Mon Sep 17 00:00:00 2001 From: Michal Barnas Date: Wed, 16 Oct 2024 09:33:02 +0000 Subject: [PATCH 6/9] add precision --- .../operation-specs/shape/squeeze-15.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 index 628a065b047f5c..2a1e44d1f5fdf1 100644 --- 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 @@ -73,7 +73,7 @@ Squeeze - + 3 2 @@ -98,7 +98,7 @@ Squeeze - + @@ -121,7 +121,7 @@ Squeeze - + @@ -144,7 +144,7 @@ Squeeze - + 2 @@ -169,6 +169,6 @@ Squeeze - + From fa1f4784ee8cc122b2cee277053dd28d9f73fc15 Mon Sep 17 00:00:00 2001 From: Michal Barnas Date: Wed, 16 Oct 2024 09:37:45 +0000 Subject: [PATCH 7/9] fix description --- .../operation-sets/operation-specs/shape/squeeze-15.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 index 2a1e44d1f5fdf1..b86daf51c132df 100644 --- 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 @@ -125,7 +125,7 @@ Squeeze -*Example 4: squeeze 2D tensor with 1 dynamic and one static shape element to a static shape output, according to the opset1 rules* +*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: @@ -150,7 +150,7 @@ Squeeze -*Example 5: squeeze 2D tensor with 1 dynamic and one static shape element to a static shape output, according to the opset15 rules* +*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: From a48596914eb72fd77f6054fd5f702df61d553a84 Mon Sep 17 00:00:00 2001 From: Michal Barnas Date: Wed, 30 Oct 2024 08:39:36 +0000 Subject: [PATCH 8/9] review suggestions --- .../operation-sets/operation-specs/shape/squeeze-15.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 index b86daf51c132df..1e112dce118e26 100644 --- 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 @@ -20,7 +20,7 @@ Squeeze .. 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`, then the dimension is considered as squeezable. Therefore the rank of the output shape will be reduced, but not dynamic. + - 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. @@ -28,7 +28,7 @@ Squeeze * *allow_axis_skip* - * **Description**: Shape inference result dynamic rank if selected axis has value 1 in range of its dynamic. + * **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* From 5d1c730bc7e57ed2e7e4ff7b18cef92e4a86b102 Mon Sep 17 00:00:00 2001 From: Michal Barnas Date: Wed, 30 Oct 2024 09:06:06 +0000 Subject: [PATCH 9/9] doc link to squeeze v15 --- .../operation-sets/available-opsets/opset15.rst | 2 +- .../openvino-ir-format/operation-sets/operation-specs.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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