diff --git a/paddle/phi/api/yaml/legacy_ops.yaml b/paddle/phi/api/yaml/legacy_ops.yaml index f0de136a56eb14dbeaca414d355122fc0950273a..cb0dfa23c99ae69defd113667bb39c1a9e63e5c5 100755 --- a/paddle/phi/api/yaml/legacy_ops.yaml +++ b/paddle/phi/api/yaml/legacy_ops.yaml @@ -1757,7 +1757,7 @@ backward : triangular_solve_grad - op : tril - args : (Tensor x, int diagonal) + args : (Tensor x, int diagonal) output : Tensor(out) infer_meta : func : TrilInferMeta @@ -1789,7 +1789,7 @@ backward : trilinear_interp_grad - op : triu - args : (Tensor x, int diagonal) + args : (Tensor x, int diagonal) output : Tensor(out) infer_meta : func : TriuInferMeta diff --git a/python/paddle/tensor/creation.py b/python/paddle/tensor/creation.py index 808e4d86d60320b725eedee6c46ccfc1d991f126..07f33b328c183f882afee33f0a8b7d6888dfd6f5 100644 --- a/python/paddle/tensor/creation.py +++ b/python/paddle/tensor/creation.py @@ -1344,7 +1344,7 @@ def tril(x, diagonal=0, name=None): # [9 , 10, 0 , 0 ]]) """ if in_dygraph_mode(): - return _C_ops.tril(x, diagonal, True) + return _C_ops.tril(x, diagonal) else: return _tril_triu_op(LayerHelper('tril', **locals())) @@ -1406,7 +1406,7 @@ def triu(x, diagonal=0, name=None): """ if in_dygraph_mode(): - return _C_ops.triu(x, diagonal, False) + return _C_ops.triu(x, diagonal) else: return _tril_triu_op(LayerHelper('triu', **locals())) diff --git a/python/paddle/tensor/math.py b/python/paddle/tensor/math.py index edd44e4e833d32485472017b606ecbe710052ac6..6c8b423172478646530fe813454bdbd24d11880c 100644 --- a/python/paddle/tensor/math.py +++ b/python/paddle/tensor/math.py @@ -4677,10 +4677,7 @@ def diff(x, n=1, axis=-1, prepend=None, append=None, name=None): outputs={"Out": out}, ) else: - out = paddle.tensor.math._subtract_with_axis( - input_back, input_front, axis=axis - ) - + out = paddle.tensor.math.subtract(input_back, input_front) return out