From b6d14d9d072ba3ad73e51d29d93b4ec1f43b7c70 Mon Sep 17 00:00:00 2001 From: LutaoChu <30695251+LutaoChu@users.noreply.github.com> Date: Tue, 11 Aug 2020 17:34:14 +0800 Subject: [PATCH] add deprecated decorator, remove alias for cumsum op (#26104) add deprecated decorator, remove alias for cumsum op --- python/paddle/fluid/layers/ops.py | 5 +++++ python/paddle/tensor/math.py | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/python/paddle/fluid/layers/ops.py b/python/paddle/fluid/layers/ops.py index c8f74c809a7..8b3e430952e 100644 --- a/python/paddle/fluid/layers/ops.py +++ b/python/paddle/fluid/layers/ops.py @@ -18,6 +18,7 @@ from .layer_function_generator import generate_layer_fn, generate_activation_fn, from .. import core from ..framework import convert_np_dtype_to_dtype_, Variable from ..data_feeder import convert_dtype, check_variable_and_dtype, check_type, check_dtype +from paddle.utils import deprecated __activations_noattr__ = [ 'sigmoid', @@ -502,6 +503,10 @@ __all__ += ['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): check_type(x, 'x', (Variable), 'cumsum') locals_var = locals().copy() diff --git a/python/paddle/tensor/math.py b/python/paddle/tensor/math.py index 7ce82e7ae31..e21aeb039f4 100644 --- a/python/paddle/tensor/math.py +++ b/python/paddle/tensor/math.py @@ -1546,9 +1546,6 @@ ${comment} 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. Args: -- GitLab