未验证 提交 b6d14d9d 编写于 作者: L LutaoChu 提交者: GitHub

add deprecated decorator, remove alias for cumsum op (#26104)

add deprecated decorator, remove alias for cumsum op
上级 65b97d62
...@@ -18,6 +18,7 @@ from .layer_function_generator import generate_layer_fn, generate_activation_fn, ...@@ -18,6 +18,7 @@ from .layer_function_generator import generate_layer_fn, generate_activation_fn,
from .. import core from .. import core
from ..framework import convert_np_dtype_to_dtype_, Variable from ..framework import convert_np_dtype_to_dtype_, Variable
from ..data_feeder import convert_dtype, check_variable_and_dtype, check_type, check_dtype from ..data_feeder import convert_dtype, check_variable_and_dtype, check_type, check_dtype
from paddle.utils import deprecated
__activations_noattr__ = [ __activations_noattr__ = [
'sigmoid', 'sigmoid',
...@@ -502,6 +503,10 @@ __all__ += ['cumsum'] ...@@ -502,6 +503,10 @@ __all__ += ['cumsum']
_cum_sum_ = generate_layer_fn('cumsum') _cum_sum_ = generate_layer_fn('cumsum')
@deprecated(
since="2.0.0",
update_to="paddle.cumsum",
reason="New APIs for Paddle 2.0 are coming.")
def cumsum(x, axis=None, exclusive=None, reverse=None): def cumsum(x, axis=None, exclusive=None, reverse=None):
check_type(x, 'x', (Variable), 'cumsum') check_type(x, 'x', (Variable), 'cumsum')
locals_var = locals().copy() locals_var = locals().copy()
......
...@@ -1546,9 +1546,6 @@ ${comment} ...@@ -1546,9 +1546,6 @@ ${comment}
def cumsum(x, axis=None, dtype=None, name=None): def cumsum(x, axis=None, dtype=None, name=None):
""" """
:alias_main: paddle.cumsum
:alias: paddle.cumsum,paddle.tensor.cumsum,paddle.tensor.math.cumsum
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. The first element of the result is the same of the first element of the input.
Args: Args:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册