Loading TOC...

cntk.depthToSpace

cntk.depthToSpace(
   $operand as cntk.variable,
   $block-size as (Number|String),
   $name as String
) as cntk.function

Summary

Rearranges elements in the input tensor from the depth dimension into spatial blocks. This operation is useful for implementing sub-pixel convolution that is part of models for image super-resolution (see [1]). It rearranges elements of an input tensor of shape (Cxbxb, H, W) to a tensor of shape (C, bxH, bxW), where b is the block_size.

Parameters
$operand Input tensor.
$block-size Integer value. This defines the size of the spatial block where the depth elements move to. Number of channels, C, in the input tensor must be divisible by math:(block_size times block_size)
$name The name of the function instance in the network.

Example

  var inputVariable1 = cntk.inputVariable(cntk.shape([2,3,4]), "float", fn.false(), fn.false(), "feature",[])
  cntk.depthToSpace(inputVariable1,2)
  => cntk.function(Composite DepthToSpace (Input(Name(feature),
  Shape([2 x 3 x 4]), Dynamic Axes([]))))

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