Loading TOC...

cntk:reshape

cntk:reshape(
   $x as cntk:variable,
   $replacement-shape as cntk:shape,
   $begin-axis as cntk:axis,
   $end-axis as cntk:axis,
   [$name as xs:string]
) as cntk:function

Summary

Reinterpret input samples as having different tensor dimensions One dimension may be specified as 0 and will be inferred. The output tensor has the shape specified by replacement-shape.

Parameters
$x Tensor to be reshaped.
$replacement-shape A tuple defining the resulting shape. The specified shape tuple may contain -1 for at most one axis, which is automatically inferred to the correct dimension size by dividing the total size of the sub-shape being reshaped with the product of the dimensions of all the non-inferred axes of the replacement shape.
$begin-axis Shape replacement begins at this axis. Negative values are counting from the end. None is the same as 0. To refer to the end of the shape tuple, pass Axis.new_leading_axis().
$end-axis Shape replacement ends at this axis (excluding this axis). Negative values are counting from the end. None refers to the end of the shape tuple.
$name The name of the function instance in the network.

Example

  let $input-variable1 := cntk:input-variable(cntk:shape((2,3,4)), "float",
    fn:false(), fn:false(), "feature")
  return cntk:reshape($input-variable1,cntk:shape((3)),cntk:axis(1), cntk:axis(2))
  => cntk:function(Composite Reshape (Input(Name(feature), Shape([2 x 3 x 4]),
  Dynamic Axes([Sequence Axis(Default Dynamic Axis), Batch Axis(Default Batch Axis)]))))
 

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