未验证 提交 16986d6b 编写于 作者: Z zyfncg 提交者: GitHub

polish some useless code (#50533)

上级 c72e2a15
...@@ -1757,7 +1757,7 @@ ...@@ -1757,7 +1757,7 @@
backward : triangular_solve_grad backward : triangular_solve_grad
- op : tril - op : tril
args : (Tensor x, int diagonal) args : (Tensor x, int diagonal)
output : Tensor(out) output : Tensor(out)
infer_meta : infer_meta :
func : TrilInferMeta func : TrilInferMeta
...@@ -1789,7 +1789,7 @@ ...@@ -1789,7 +1789,7 @@
backward : trilinear_interp_grad backward : trilinear_interp_grad
- op : triu - op : triu
args : (Tensor x, int diagonal) args : (Tensor x, int diagonal)
output : Tensor(out) output : Tensor(out)
infer_meta : infer_meta :
func : TriuInferMeta func : TriuInferMeta
......
...@@ -1344,7 +1344,7 @@ def tril(x, diagonal=0, name=None): ...@@ -1344,7 +1344,7 @@ def tril(x, diagonal=0, name=None):
# [9 , 10, 0 , 0 ]]) # [9 , 10, 0 , 0 ]])
""" """
if in_dygraph_mode(): if in_dygraph_mode():
return _C_ops.tril(x, diagonal, True) return _C_ops.tril(x, diagonal)
else: else:
return _tril_triu_op(LayerHelper('tril', **locals())) return _tril_triu_op(LayerHelper('tril', **locals()))
...@@ -1406,7 +1406,7 @@ def triu(x, diagonal=0, name=None): ...@@ -1406,7 +1406,7 @@ def triu(x, diagonal=0, name=None):
""" """
if in_dygraph_mode(): if in_dygraph_mode():
return _C_ops.triu(x, diagonal, False) return _C_ops.triu(x, diagonal)
else: else:
return _tril_triu_op(LayerHelper('triu', **locals())) return _tril_triu_op(LayerHelper('triu', **locals()))
......
...@@ -4677,10 +4677,7 @@ def diff(x, n=1, axis=-1, prepend=None, append=None, name=None): ...@@ -4677,10 +4677,7 @@ def diff(x, n=1, axis=-1, prepend=None, append=None, name=None):
outputs={"Out": out}, outputs={"Out": out},
) )
else: else:
out = paddle.tensor.math._subtract_with_axis( out = paddle.tensor.math.subtract(input_back, input_front)
input_back, input_front, axis=axis
)
return out return out
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册