-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Opset15][Spec] Col2Im-15 specification #23947
Merged
Merged
Changes from 8 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
d0ee316
initial commit
p-wysocki d06bed4
Update docs/articles_en/documentation/openvino-ir-format/operation-se…
p-wysocki 0e541b0
Merge remote-tracking branch 'upstream/master' into col2im_spec
p-wysocki 39ee005
Apply CR
p-wysocki d64563d
Merge branch 'col2im_spec' of https://github.com/p-wysocki/openvino i…
p-wysocki d7eff8e
Minor update
p-wysocki 68782db
Update docs/articles_en/documentation/openvino-ir-format/operation-se…
p-wysocki 9f95220
minor update
p-wysocki c31c5f3
Update
p-wysocki af36fc1
Update docs/articles_en/documentation/openvino-ir-format/operation-se…
p-wysocki fd4865d
Update latex equation
p-wysocki dbb09d0
Merge branch 'master' of https://github.com/openvinotoolkit/openvino …
p-wysocki 86a35fa
Merge branch 'col2im_spec' of https://github.com/p-wysocki/openvino i…
p-wysocki 67db605
Merge branch 'master' of https://github.com/openvinotoolkit/openvino …
p-wysocki 81a9459
Apply CR
p-wysocki 769428f
Apply CR
p-wysocki 708252d
Minor change
p-wysocki d13b3b4
Apply CR
p-wysocki f7c4ad9
Merge branch 'master' of https://github.com/openvinotoolkit/openvino …
p-wysocki c5f0c96
Turn equation into text
p-wysocki 3b48cbc
Merge branch 'master' of https://github.com/openvinotoolkit/openvino …
p-wysocki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
169 changes: 169 additions & 0 deletions
169
...tation/openvino-ir-format/operation-sets/operation-specs/movement/col2im-15.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
.. {#openvino_docs_ops_type_Col2Im_15} | ||
|
||
Col2Im | ||
=================== | ||
|
||
|
||
.. meta:: | ||
:description: Learn about Col2Im-15 - data movement operation which combines sliding blocks into an image tensor. | ||
|
||
**Versioned name**: *Col2Im-15* | ||
|
||
**Category**: *Data movement* | ||
|
||
**Short description**: *Col2Im* operation constructs an image based on ``input`` tensor containing sliding data blocks (blocks of the image) and desired ``output_size``. | ||
|
||
**Detailed description** | ||
|
||
Consider an ``input`` tensor containing batches of image blocks of shape ``(N, C * Product(kernel_size), L)``, where: | ||
|
||
* ``N`` is the batch dimension, | ||
* ``C * Product(kernel_size)`` is the number of elements within a block (each block contains ``Product(kernel_size)`` vectors containing values from each channel ``C``), | ||
* ``L`` is the total number of blocks calculated as follows: | ||
|
||
.. math:: | ||
|
||
L = \prod_{d=1}^{2} \left\lfloor \frac{({\text{{output\_size}}[d] + \text{{pads\_begin}}[d] + \text{{pads\_end}}[d] - \text{{dilation}}[d] \times (\text{{kernel\_size}}[d] - 1) - 1}}{{\text{{stride}}[d]}}) + 1\rfloor | ||
|
||
|
||
where ``d`` is over all spatial dimensions. | ||
|
||
The ``input`` blocks are being moved into the ``output`` tensor of shape ``(N, C, output_size[0], output_size[1])`` by combining the values contained in blocks. | ||
|
||
**Attributes**: | ||
|
||
* *output_size* | ||
|
||
* **Description**: controls the shape of the spatial dimensions of the output image. | ||
* **Range of values**: 1D tensor of non-negative integer numbers | ||
* **Type**: *T_IND* | ||
* **Required**: *yes* | ||
|
||
* *kernel_size* | ||
|
||
* **Description**: size of the sliding blocks. | ||
* **Range of values**: 1D tensor of non-negative integer numbers | ||
* **Type**: *T_IND* | ||
* **Required**: *yes* | ||
p-wysocki marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
* *strides* | ||
|
||
* **Description**: stride in the sliding blocks in the input spatial dimensions. | ||
* **Range of values**: 1D tensor of non-negative integer numbers | ||
p-wysocki marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* **Type**: *T_IND* | ||
* **Default value**: [1, 1] | ||
* **Required**: *no* | ||
|
||
* *dilations* | ||
|
||
* **Description**: controls local stride of the elements. | ||
* **Range of values**: 1D tensor of non-negative integer numbers | ||
* **Type**: *T_IND* | ||
* **Default value**: [1, 1] | ||
* **Required**: *no* | ||
|
||
* *pads_begin* | ||
|
||
* **Description**: *pads_begin* is a number of zero-value pixels to add to the beginning along each axis. For example, *pads_begin* equal "1,2" means adding 1 pixel to the top of the input and 2 to the left of the input. | ||
* **Range of values**: 1D tensor of non-negative integer numbers | ||
* **Type**: *T_IND* | ||
* **Default value**: [0, 0] | ||
* **Required**: *no* | ||
|
||
* *pads_end* | ||
|
||
* **Description**: *pads_end* is a number of zero-value pixels to add to the ending along each axis. For example, *pads_end* equal "1,2" means adding 1 pixel to the bottom of the input and 2 to the right of the input. | ||
* **Range of values**: 1D tensor of non-negative integer numbers | ||
* **Type**: *T_IND* | ||
* **Default value**: [0, 0] | ||
* **Required**: *no* | ||
|
||
**Inputs** | ||
|
||
* **1**: A 4D tensor of type *T* and shape ``(N, C * Product(kernel_size), L)``. **Required.** | ||
|
||
**Outputs** | ||
|
||
* **1**: The output tensor the output image of shape ``(N, C, output_size[0], output_size[1])`` and type *T*. | ||
|
||
**Types** | ||
|
||
* *T*: any supported data type. | ||
* *T_IND*: ``int64`` or ``int32``. | ||
|
||
**Examples** | ||
|
||
All examples assume ``C = 3``. | ||
|
||
*Example 1: default optional Parameters* | ||
|
||
.. code-block:: xml | ||
:force: | ||
|
||
<layer ... type="Col2Im" ... > | ||
<data output_size="16,16" kernel_size="2,2"/> | ||
p-wysocki marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<input> | ||
<port id="0" precision="I32"> | ||
<dim>3</dim> <!-- batch_axis --> | ||
<dim>12</dim> <!-- C * Product(kernel_size) --> | ||
<dim>225</dim> <!-- L --> | ||
</port> | ||
</input> | ||
<output> | ||
<port id="1" precision="I32"> | ||
<dim>3</dim> <!-- batch_axis --> | ||
<dim>3</dim> <!-- C --> | ||
<dim>16</dim> <!-- output_size[0] --> | ||
<dim>16</dim> <!-- output_size[1] --> | ||
</port> | ||
</output> | ||
</layer> | ||
|
||
|
||
*Example 2: non-default dilation, padding and stride* | ||
|
||
.. code-block:: xml | ||
:force: | ||
|
||
<layer ... type="Col2Im" ... > | ||
<data output_size="16,16" kernel_size="3,3" dilation="2,2" pads_begin="1,1" pads_end="1,1" stride="2,2"/> | ||
<input> | ||
<port id="0" precision="I32"> | ||
<dim>1</dim> <!-- batch_axis --> | ||
<dim>27/dim> <!-- C * Product(kernel_size) --> | ||
<dim>25</dim> <!-- L --> | ||
</port> | ||
</input> | ||
<output> | ||
<port id="1" precision="I32"> | ||
<dim>1</dim> <!-- batch_axis --> | ||
<dim>3</dim> <!-- C --> | ||
<dim>16</dim> <!-- output_size[0] --> | ||
<dim>16</dim> <!-- output_size[1] --> | ||
</port> | ||
</output> | ||
</layer> | ||
|
||
*Example 2: non-default dilation and padding* | ||
|
||
.. code-block:: xml | ||
:force: | ||
|
||
<layer ... type="Col2Im" ... > | ||
<data output_size="32,32" kernel_size="2,2" dilation="2,2" pads_begin="3,3" pads_end="3,3"/> | ||
<input> | ||
<port id="0" precision="I32"> | ||
<dim>12</dim> <!-- batch_axis --> | ||
<dim>12/dim> <!-- C * Product(kernel_size) --> | ||
<dim>1296</dim> <!-- L --> | ||
p-wysocki marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</port> | ||
</input> | ||
<output> | ||
<port id="1" precision="I32"> | ||
<dim>12</dim> <!-- batch_axis --> | ||
<dim>3</dim> <!-- C --> | ||
<dim>32</dim> <!-- output_size[0] --> | ||
<dim>32</dim> <!-- output_size[1] --> | ||
</port> | ||
</output> | ||
</layer> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where
d
goes only up to2
sinceCol2Im
works only for images with 2 spatial dimensions andpads_begin
andpads_end
are applied separately to follow OpenVINO convention.