You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Accuracy diff No.167] Fix accuracy (output type) diff for paddle.cumsum API (#74625)
* fix(math.py, unary.cc): fix output type diff for cumsum kernel
* fix(math.py): fix output type diff for cumsum kernel
* fix(math.py): fix `cumsum` documentation
* fix(cum/cum_grad.cc/cu, test_cumsum_op.py): fix output type diff for cumsum kernel and add unit test
Copy file name to clipboardExpand all lines: python/paddle/tensor/math.py
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4152,7 +4152,7 @@ def cumsum(
4152
4152
Args:
4153
4153
x (Tensor): The input tensor needed to be cumsumed.
4154
4154
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.
4155
-
dtype (str|paddle.dtype|np.dtype|None, optional): The data type of the output tensor, can be bfloat16, float16, float32, float64, int32, int64, complex64, complex128. 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.
4155
+
dtype (str|paddle.dtype|np.dtype|None, optional): The data type of the output tensor, can be bfloat16, float16, float32, float64, int32, int64, complex64, complex128. By default, it is int64 if the input x is int8/int16/int32; otherwise, it is None. If it is not None, the input tensor is casted to dtype before the operation is performed. This is useful for preventing data type overflows.
4156
4156
name (str|None, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.
0 commit comments