From 1df2ee6c66825017ef87a9a31b9258553093cbb9 Mon Sep 17 00:00:00 2001 From: Hui Zhang Date: Fri, 16 Jun 2023 15:38:53 +0800 Subject: [PATCH] int32/int64 forward (#54687) --- python/paddle/tensor/math.py | 4 ++-- test/legacy_test/test_logaddexp.py | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/python/paddle/tensor/math.py b/python/paddle/tensor/math.py index 3e1afa74730..9aa77730262 100644 --- a/python/paddle/tensor/math.py +++ b/python/paddle/tensor/math.py @@ -675,8 +675,8 @@ def logaddexp(x, y, name=None): shape(X) = (2, 3, 4, 5), shape(Y) = (2, 1), with axis=0 Args: - x (Tensor): Tensor or LoDTensor of any dimensions. Its dtype should be float32, float64, float16. - y (Tensor): Tensor or LoDTensor of any dimensions. Its dtype should be float32, float64, float16. + x (Tensor): Tensor or LoDTensor of any dimensions. Its dtype should be int32, int64, float32, float64, float16. + y (Tensor): Tensor or LoDTensor of any dimensions. Its dtype should be int32, int64, float32, float64, float16. name (string, optional): For details, please refer to :ref:`api_guide_Name`. Generally, no setting is required. Default: None. Returns: diff --git a/test/legacy_test/test_logaddexp.py b/test/legacy_test/test_logaddexp.py index 434fae3d8f3..1c9e66fb129 100644 --- a/test/legacy_test/test_logaddexp.py +++ b/test/legacy_test/test_logaddexp.py @@ -66,6 +66,18 @@ class TestLogsumexpAPI(unittest.TestCase): self.dtype = np.float32 self.api_case() + def test_api_int32(self): + self.xshape = [10, 200, 300] + self.yshape = [10, 200, 300] + self.dtype = np.int32 + self.api_case() + + def test_api_int64(self): + self.xshape = [10, 200, 300] + self.yshape = [10, 200, 300] + self.dtype = np.int64 + self.api_case() + if __name__ == '__main__': unittest.main() -- GitLab