The cumulative sum of the elements along a given axis. The first element of the result is the same of the first element of the input.
The cumulative sum of the elements along a given axis.
**Note**:
The first element of the result is the same of the first element of the input.
Args:
x (Tensor): Input of cumsum operator, the Tensor needed to be cumsumed.
x (Tensor): The input tensor needed to be cumsumed.
axis (int, optional): The dimension to accumulate along. -1 means the last dimension. The default (None) is to compute the cumsum over the flattened array.
dtype (str, optional): The data type of the output tensor, can be float32, float64, int32, int64. If specified, the input tensor is casted to dtype before the operation is performed. This is useful for preventing data type overflows. The default value is None.
name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.
Returns:
Tensor, the result of cumsum operator, output of cumsum operator.