Loading TOC...

cntk:space-to-depth

cntk:space-to-depth(
   $operand as cntk:variable,
   $block-size as xs:unsignedLong,
   $name as xs:string
) as cntk:function

Summary

Rearranges elements in the input tensor from the spatial dimensions to the depth dimension. This is the reverse transformation of depth_to_space. This operation is useful for implementing and testing sub-pixel convolution that is part of models for image super-resolution (see [1]). It rearranges elements of an input tensor of shape (C, H, W) to a tensor of shape (C*b*b, H/b, W/b), where b is the block_size, by rearranging non-overlapping spatial blocks of size block_size x block_size into the depth/channel dimension at each location.

Parameters
$operand Input tensor.
$block-size Integer value. This defines the size of the spatial block whose elements are moved to the depth dimension. Size of spatial dimensions (H, W) in the input tensor must be divisible by math:block_size.
$name The name of the function instance in the network.

Example

  let $input-variable1 := cntk:input-variable(cntk:shape((2,2,4)), "float",
    fn:false(), fn:false(), "feature",())
  return cntk:space-to-depth($input-variable1,1)
  => cntk:function(Composite SpaceToDepth (Input(Name(feature),
  Shape([2 x 2 x 4]), Dynamic Axes([]))))

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.