Skip to content
2 changes: 1 addition & 1 deletion python/paddle/utils/deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def deprecated(update_to="", since="", reason="", level=0):

def decorator(func):
# TODO(zhiqiu): temporally disable the warnings
return func
# return func
"""construct warning message, and return a decorated function or class."""
assert isinstance(update_to, str), 'type of "update_to" must be str.'
assert isinstance(since, str), 'type of "since" must be str.'
Expand Down
2 changes: 1 addition & 1 deletion test/legacy_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ if(((NOT WITH_ROCM) AND (NOT WITH_GPU)) OR WIN32)
list(REMOVE_ITEM TEST_OPS test_fleet_executor_cond_interceptor)
endif()

list(REMOVE_ITEM TEST_OPS test_deprecated_decorator)
# list(REMOVE_ITEM TEST_OPS test_deprecated_decorator)

if(WIN32)
list(REMOVE_ITEM TEST_OPS test_multiprocess_reader_exception)
Expand Down
30 changes: 4 additions & 26 deletions test/legacy_test/test_deprecated_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,18 @@
import numpy as np

import paddle
from paddle import _legacy_C_ops
from paddle.utils import deprecated

LOWEST_WARNING_POSTION = 3
ERROR_WARNING_POSTION = sys.maxsize

# custom paddle version
paddle.version.major = '1'
paddle.version.minor = '8'
paddle.version.major = '0'
paddle.version.minor = '0'
paddle.version.patch = '0'
paddle.version.rc = '0'
paddle.__version__ = '1.8.0'
paddle.version.full_version = '1.8.0'
paddle.__version__ = '0.0.0'
paddle.version.full_version = '0.0.0'
print("current paddle version: ", paddle.__version__)

paddle.disable_static()
Expand Down Expand Up @@ -87,27 +86,6 @@ def test_new_multiply(self):
# testting
self.assertLess(expected, captured)

def test_ops_elementwise_mul(self):
"""
Test for new C++ elementwise_op, expected result should be True,
because not matter what base.layers.elementwise_mul is deprecated.
"""

a = np.random.uniform(0.1, 1, [51, 76]).astype(np.float32)
b = np.random.uniform(0.1, 1, [51, 76]).astype(np.float32)
x = paddle.to_tensor(a)
y = paddle.to_tensor(b)
res = _legacy_C_ops.elementwise_mul(x, y)

# expected
expected = LOWEST_WARNING_POSTION

# captured
captured = get_warning_index(paddle.multiply)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是当时测试 fluid.layers.elementwise_mul 写的,2.0 之后就删除了api 映射表,这里的paddle.multipy 是当时清理 fluid #48748 的时候修改成这样的。当时的这个单测被暂时关闭,也就没有检测,这里就删除了


# testting
self.assertGreater(expected, captured)

def test_tensor_gradient(self):
paddle.__version__ = '2.1.0'

Expand Down