Files
openvino/docs/ops/movement/DepthToSpace_1.md
Maciej Smyk 5682e178dd DOCS shift to rst - Opsets D (#17205)
* Update Operations_specifications.md

* Update Divide_1.md

* Update DFT_7.md

* Update DetectionOutput_8.md

* Update DetectionOutput_1.md

* Update DetectionOutput_1.md

* Update DepthToSpace_1.md

* Update DeformablePSROIPooling_1.md

* Update DeformableConvolution_8.md

* Update DeformableConvolution_1.md

* Update DeformableConvolution_8.md

* fix

* fix

* Update DFT_7.md

* Update DFT_7.md

---------

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>
2023-04-26 10:11:13 +02:00

3.1 KiB

DepthToSpace

@sphinxdirective

Versioned name: DepthToSpace-1

Category: Data movement

Short description: DepthToSpace operation rearranges data from the depth dimension of the input tensor into spatial dimensions of the output tensor.

Detailed description

DepthToSpace operation permutes elements from the input tensor with shape [N, C, D1, D2, ..., DK], to the output tensor where values from the input depth dimension (features) C are moved to spatial blocks in D1, ..., DK.

The operation is equivalent to the following transformation of the input tensor data with K spatial dimensions of shape [N, C, D1, D2, ..., DK] to Y output tensor. If mode = blocks_first:

.. code-block:: cpp

x' = reshape(data, [N, block_size, block_size, ..., block_size, C / (block_size ^ K), D1, D2, ..., DK]) x'' = transpose(x', [0, K + 1, K + 2, 1, K + 3, 2, K + 4, 3, ..., K + (K + 1), K]) y = reshape(x'', [N, C / (block_size ^ K), D1 * block_size, D2 * block_size, D3 * block_size, ..., DK * block_size])

If mode = depth_first:

.. code-block:: cpp

x' = reshape(data, [N, C / (block_size ^ K), block_size, block_size, ..., block_size, D1, D2, ..., DK]) x'' = transpose(x', [0, 1, K + 2, 2, K + 3, 3, K + 4, 4, ..., K + (K + 1), K + 1]) y = reshape(x'', [N, C / (block_size ^ K), D1 * block_size, D2 * block_size, D3 * block_size, ..., DK * block_size])

Attributes

  • block_size

    • Description: specifies the size of the value block to be moved. The depth dimension size must be evenly divided by block_size ^ (len(input.shape) - 2).
    • Range of values: a positive integer
    • Type: int
    • Default value: 1
    • Required: no
  • mode

    • Description: specifies how the input depth dimension is split to block coordinates and the new depth dimension.

    • Range of values:

      • blocks_first: the input depth is divided to [block_size, ..., block_size, new_depth]
      • depth_first: the input depth is divided to [new_depth, block_size, ..., block_size]
    • Type: string

    • Required: yes

Inputs

  • 1: data - input tensor of type T with rank >= 3. Required.

Outputs

  • 1: permuted tensor of type T and shape [N, C / block_size ^ K, D1 * block_size, D2 * block_size, ..., DK * block_size].

Types

  • T: any supported type.

Example

.. code-block:: cpp

<layer type="DepthToSpace" ...> 5 28 2 3 5 < !-- data.shape[0] --> 7 < !-- data.shape[1] / (block_size ^ 2) --> 4 < !-- data.shape[2] * block_size --> 6 < !-- data.shape[3] * block_size -->

@endsphinxdirective