Files
openvino/docs/ops/arithmetic/CumSum_3.md
Nikolay Tyukaev ef45b5da8d Doc Migration (master) (#1377)
* Doc Migration from Gitlab (#1289)

* doc migration

* fix

* Update FakeQuantize_1.md

* Update performance_benchmarks.md

* Updates graphs for FPGA

* Update performance_benchmarks.md

* Change DL Workbench structure (#1)

* Changed DL Workbench structure

* Fixed tags

* fixes

* Update ie_docs.xml

* Update performance_benchmarks_faq.md

* Fixes in DL Workbench layout

* Fixes for CVS-31290

* [DL Workbench] Minor correction

* Fix for CVS-30955

* Added nGraph deprecation notice as requested by Zoe

* fix broken links in api doxy layouts

* CVS-31131 fixes

* Additional fixes

* Fixed POT TOC

* Update PAC_Configure.md

PAC DCP 1.2.1 install guide.

* Update inference_engine_intro.md

* fix broken link

* Update opset.md

* fix

* added opset4 to layout

* added new opsets to layout, set labels for them

* Update VisionAcceleratorFPGA_Configure.md

Updated from 2020.3 to 2020.4

Co-authored-by: domi2000 <domi2000@users.noreply.github.com>
2020-07-20 17:36:08 +03:00

3.4 KiB

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:

  • exclusive

    • Description: If the attribute is set to true then an exclusive sum in which the top element is not included is returned. In other terms, if set to true, the j-th output element would be the sum of the first (j-1) elements. Otherwise, it would be the sum of the first j elements.
    • Range of values:
      • false - include the top element
      • true - do not include the top element
    • Type: boolean
    • Default value: false
    • Required: no
  • reverse

    • Description: If set to true will perform the sums in reverse direction.
    • Range of values:
      • false - do not perform sums in reverse direction
      • true - perform sums in reverse direction
    • Type: boolean
    • Default value: false
    • Required: no

Inputs

  • 1: An tensor of type T. Required.

  • 2: Scalar axis of type T_AXIS. Negative value means counting dimensions from the back. Default value is 0. Optional.

Outputs

  • 1: Output tensor with cumulative sums of the input's elements. A tensor of type T of the same shape as 1st input.

Types

  • T: any numeric type.

  • T_AXIS: any integer number.

Examples

Example 1

<layer ... type="CumSum" exclusive="0" reverse="0">
    <input>
        <port id="0">     <!-- input value is: [1., 2., 3., 4., 5.] -->
            <dim>5</dim>
        </port>
        <port id="1"/>     <!-- axis value is: 0 -->
    </input>
    <output>
        <port id="2">     <!-- output value is: [1., 3., 6., 10., 15.] -->
            <dim>5</dim>
        </port>
    </output>
</layer>

Example 2

<layer ... type="CumSum" exclusive="1" reverse="0">
    <input>
        <port id="0">     <!-- input value is: [1., 2., 3., 4., 5.] -->
            <dim>5</dim>
        </port>
        <port id="1"/>     <!-- axis value is: 0 -->
    </input>
    <output>
        <port id="2">     <!-- output value is: [0., 1., 3., 6., 10.] -->
            <dim>5</dim>
        </port>
    </output>
</layer>

Example 3

<layer ... type="CumSum" exclusive="0" reverse="1">
    <input>
        <port id="0">     <!-- input value is: [1., 2., 3., 4., 5.] -->
            <dim>5</dim>
        </port>
        <port id="1"/>     <!-- axis value is: 0 -->
    </input>
    <output>
        <port id="2">     <!-- output value is: [15., 14., 12., 9., 5.] -->
            <dim>5</dim>
        </port>
    </output>
</layer>

Example 4

<layer ... type="CumSum" exclusive="1" reverse="1">
    <input>
        <port id="0">     <!-- input value is: [1., 2., 3., 4., 5.] -->
            <dim>5</dim>
        </port>
        <port id="1"/>     <!-- axis value is: 0 -->
    </input>
    <output>
        <port id="2">     <!-- output value is: [14., 12., 9., 5., 0.] -->
            <dim>5</dim>
        </port>
    </output>
</layer>