CumSum

Versioned name: CumSum-3

Category: Arithmetic unary operation

Short description: CumSum performs cumulative summation of the input elements along the given axis.

Detailed description: By default, it will do the sum inclusively meaning the first element is copied as is. Through an "exclusive" attribute, this behavior can change to exclude the first element. It can also perform summation in the opposite direction of the axis. For that, set reverse attribute to true.

Attributes:

Inputs

Outputs

Types

Examples

Example 1

<layer ... type="CumSum" exclusive="0" reverse="0">
<input>
<port id="0">
<dim>5</dim>
</port>
<port id="1"/>
</input>
<output>
<port id="2">
<dim>5</dim>
</port>
</output>
</layer>

Example 2

<layer ... type="CumSum" exclusive="1" reverse="0">
<input>
<port id="0">
<dim>5</dim>
</port>
<port id="1"/>
</input>
<output>
<port id="2">
<dim>5</dim>
</port>
</output>
</layer>

Example 3

<layer ... type="CumSum" exclusive="0" reverse="1">
<input>
<port id="0">
<dim>5</dim>
</port>
<port id="1"/>
</input>
<output>
<port id="2">
<dim>5</dim>
</port>
</output>
</layer>

Example 4

<layer ... type="CumSum" exclusive="1" reverse="1">
<input>
<port id="0">
<dim>5</dim>
</port>
<port id="1"/>
</input>
<output>
<port id="2">
<dim>5</dim>
</port>
</output>
</layer>