未验证 提交 ed33b860 编写于 作者: C ccrrong 提交者: GitHub

remove triu from fluid (#48427)

* remove triu

* use paddle.triu
上级 b6b6fca6
......@@ -68,7 +68,6 @@ __all__ = [
'zeros_like',
'ones_like',
'diag',
'triu',
]
......@@ -1830,10 +1829,3 @@ def ones_like(x, out=None):
outputs={'Out': [out]},
)
return out
@deprecated(since="2.0.0", update_to="paddle.triu")
def triu(input, diagonal=0, name=None):
import paddle
return paddle.tensor.triu(x=input, diagonal=diagonal, name=name)
......@@ -184,7 +184,7 @@ class TestTrilTriuOpAPI(unittest.TestCase):
with program_guard(prog, startup_prog):
data = np.random.random([1, 9, 9, 4]).astype(dtype)
x = fluid.data(shape=[1, 9, -1, 4], dtype=dtype, name='x')
triu_out = fluid.layers.triu(x)
triu_out = paddle.triu(x)
place = fluid.MLUPlace(0)
exe = fluid.Executor(place)
......
......@@ -185,7 +185,7 @@ class TestTrilTriuOpAPI(unittest.TestCase):
with program_guard(prog, startup_prog):
data = np.random.random([1, 9, 9, 4]).astype(dtype)
x = fluid.data(shape=[1, 9, -1, 4], dtype=dtype, name='x')
triu_out = fluid.layers.triu(x)
triu_out = paddle.triu(x)
place = fluid.NPUPlace(0)
exe = fluid.Executor(place)
......
......@@ -183,7 +183,7 @@ class TestTrilTriuOpAPI(unittest.TestCase):
with program_guard(prog, startup_prog):
data = np.random.random([1, 9, 9, 4]).astype(dtype)
x = fluid.data(shape=[1, 9, -1, 4], dtype=dtype, name='x')
triu_out = fluid.layers.triu(x)
triu_out = paddle.triu(x)
place = (
fluid.CUDAPlace(0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册