CumSum

Description

Performs cumulative sum of the input elements along the given axis. 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.

 

Documentation illustration (illustration unavailable in the archive).

 

Input parameters

 

specified_outputs_name : array, this parameter lets you manually assign custom names to the output tensors of a node.

 Graphs in : cluster, ONNX model architecture.

x (heterogeneous) – T : object, an input tensor that is to be processed.
axis (heterogeneous) – T2 : object, a 0-D tensor. Must be in the range [-rank(x), rank(x)-1]. Negative value means counting dimensions from the back.

Documentation illustration (illustration unavailable in the archive).

 Parameters : cluster,

exclusive : boolean, if set to true will return exclusive sum in which the top element is not included. 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.
Default value “False”.
reserve : boolean, if set to true will perform the sums in reverse direction.
Default value “False”.
 training? : boolean, whether the layer is in training mode (can store data for backward).
Default value “True”.
 lda coeff : float, defines the coefficient by which the loss derivative will be multiplied before being sent to the previous layer (since during the backward run we go backwards).
Default value “1”.

 name (optional) : string, name of the node.

Documentation illustration (illustration unavailable in the archive).

Output parameters

 

y (heterogeneous) – T : object, output tensor of the same type as ‘x’ with cumulative sums of the x’s elements.

Type Constraints

T in (tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(int32), tensor(int64), tensor(uint32),
tensor(uint64)) : Constrain input and output types to high-precision numeric tensors.

 

T2 in (tensor(int32), tensor(int64)) : axis tensor can be int32 or int64 only.

Example

All these exemples are snippets PNG, you can drop these Snippet onto the block diagram and get the depicted code added to your VI (Do not forget to install Deep Learning library to run it).