From ba51a6c8101714dbd03a60830e79c64cb9af7bef Mon Sep 17 00:00:00 2001 From: Tao Luo Date: Fri, 21 Jan 2022 12:05:09 +0800 Subject: [PATCH] fix gcd and lcm data type (#39043) --- python/paddle/tensor/math.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python/paddle/tensor/math.py b/python/paddle/tensor/math.py index c4a92b1486..a476a8ccd1 100755 --- a/python/paddle/tensor/math.py +++ b/python/paddle/tensor/math.py @@ -3559,8 +3559,8 @@ def gcd(x, y, name=None): If x.shape != y.shape, they must be broadcastable to a common shape (which becomes the shape of the output). Args: - x (Tensor): An N-D Tensor, the data type is int8,int16,int32,int64,uint8. - y (Tensor): An N-D Tensor, the data type is int8,int16,int32,int64,uint8. + x (Tensor): An N-D Tensor, the data type is int32,int64. + y (Tensor): An N-D Tensor, the data type is int32,int64. name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`. Returns: @@ -3621,8 +3621,8 @@ def gcd(x, y, name=None): return x else: - check_variable_and_dtype(x, 'x', ['int32', 'int64', 'int8', 'int16', 'uint8'], 'gcd') - check_variable_and_dtype(y, 'y', ['int32', 'int64', 'int8', 'int16', 'uint8'], 'gcd') + check_variable_and_dtype(x, 'x', ['int32', 'int64'], 'gcd') + check_variable_and_dtype(y, 'y', ['int32', 'int64'], 'gcd') out, _ = paddle.static.nn.while_loop(_gcd_cond_fn, _gcd_body_fn, [x, y]) return out @@ -3637,8 +3637,8 @@ def lcm(x, y, name=None): If x.shape != y.shape, they must be broadcastable to a common shape (which becomes the shape of the output). Args: - x (Tensor): An N-D Tensor, the data type is int8,int16,int32,int64,uint8. - y (Tensor): An N-D Tensor, the data type is int8,int16,int32,int64,uint8. + x (Tensor): An N-D Tensor, the data type is int32,int64. + y (Tensor): An N-D Tensor, the data type is int32,int64. name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`. Returns: -- GitLab