Loading TOC...

cntk:reduce-sum

cntk:reduce-sum(
   $operand as cntk:variable,
   $axis as cntk:axis,
   [$name as xs:string]
) as cntk:function

Summary

Computes the sum of the input tensor’s elements across one axis or a list of axes. If the axis parameter is not specified then the sum will be computed over all static axes, which is equivalent with specifying axis=Axis.all_static_axes(). If axis=Axis.all_axes() is specified, then the output is a scalar which is the sum of all the elements in the minibatch. And if axis=Axis.default_batch_axis() is specified, then the reduction will happen across the batch axis (In this case the input must not be a sequence).

Parameters
$operand The operand of the operation.
$axis Axis along which the reduction will be performed.
$name The name of the function instance in the network.

Example

  let $input-variable1 := cntk:input-variable(cntk:shape((3)), "float", fn:false(),
    fn:false(), "feature")
  return cntk:reduce-sum($input-variable1, cntk:axis(0), "x,")
  => cntk:function(Composite ReduceElements (Input(Name(feature), Shape([3]),
  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.