diff --git a/python/paddle/tensor/math.py b/python/paddle/tensor/math.py index 0c23240cdc19f637d386f6ae50eb47b85776ad25..8c15f8633a8975f76b02f47bd94fa00ea2432545 100644 --- a/python/paddle/tensor/math.py +++ b/python/paddle/tensor/math.py @@ -4484,7 +4484,7 @@ def diff(x, n=1, axis=-1, prepend=None, append=None, name=None): if x.dtype == paddle.bool: return _C_ops.final_state_logical_xor(input_back, input_front) else: - return elementwise_sub(input_back, input_front, axis=axis) + return _C_ops.final_state_subtract(input_back, input_front) elif _in_legacy_dygraph(): has_pend = False input_list = []