openvino.runtime.opset2.depth_to_space(node: openvino._pyopenvino.Node, mode: str, block_size: int = 1, name: Optional[str] = None) openvino._pyopenvino.Node

Rearranges input tensor from depth into blocks of spatial data.

Values from the height and width dimensions are moved to the depth dimension.

Input tensor has shape [N,C,H,W], where N is the batch axis, C is the channel or depth, H is the height and W is the width.

Output node produces a tensor with shape:

[N, C * block_size * block_size, H / block_size, W / block_size]

  • node – The node with input tensor data.

  • mode

    Specifies how the input depth dimension is split to block coordinates

    blocks_first: The input is divided to [block_size, …, block_size, new_depth] depth_first: The input is divided to [new_depth, block_size, …, block_size]

  • block_size – The size of the spatial block of values describing how the tensor’s data is to be rearranged.

  • name – Optional output node name.


The new node performing an DepthToSpace operation on its input tensor.