diff --git a/python/paddle/tensor/logic.py b/python/paddle/tensor/logic.py index 865b2a62d4ca21..6f7ece749afff6 100755 --- a/python/paddle/tensor/logic.py +++ b/python/paddle/tensor/logic.py @@ -907,6 +907,7 @@ def less_than(x, y, name=None): "float16", "float32", "float64", + "int16", "int32", "int64", "uint16", @@ -921,6 +922,7 @@ def less_than(x, y, name=None): "float16", "float32", "float64", + "int16", "int32", "int64", "uint16", diff --git a/test/legacy_test/test_compare_op.py b/test/legacy_test/test_compare_op.py index 91dce088ef88ef..7c8f3829738da9 100755 --- a/test/legacy_test/test_compare_op.py +++ b/test/legacy_test/test_compare_op.py @@ -615,6 +615,21 @@ def test_place_2(self): self.assertEqual((result.numpy() == np.array([False])).all(), True) +class TestLessThanInt8(unittest.TestCase): + def test_less_than_int8(self): + # Create a tensor of type int8 + x = paddle.to_tensor([1, 2, 3], dtype='int16') + y = paddle.to_tensor([1, 3, 2], dtype='int16') + + result = paddle.less_than(x, y) + + # desired output + expected = np.array([False, True, False]) + + # Verify output + self.assertTrue((result.numpy() == expected).all()) + + if __name__ == '__main__': paddle.enable_static() unittest.main() diff --git a/third_party/mkldnn b/third_party/mkldnn index 01204edbda1c2a..403667673f61a5 160000 --- a/third_party/mkldnn +++ b/third_party/mkldnn @@ -1 +1 @@ -Subproject commit 01204edbda1c2a4ff0cccd40476ed6bd2fb62d56 +Subproject commit 403667673f61a56289622fd5bc587b1856296fbc