nn.depth_to_space
DepthToSpace rearranges (permutes) data from depth into blocks of spatial data. This is the reverse transformation of SpaceToDepth. More specifically, this op outputs a copy of the input tensor where values from the depth dimension are moved in spatial blocks to the height and width dimensions. By default, mode = DCR. In the DCR mode, elements along the depth dimension from the input tensor are rearranged in the following order: depth, column, and then row.
Args
tensor
(@Tensor<T>
) - The input tensor of [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.blocksize
(usize
) - The size of the blocks to move along [blocksize, blocksize].mode
(felt252) - DCR (default) for depth-column-row order re-arrangement. Use CRD for column-row-depth order.
Returns
A Tensor<T>
of [N, C/(blocksize * blocksize), H * blocksize, W * blocksize].
Examples
Last updated