From 55a77d5948d00577a3fa6d7d6926198446948498 Mon Sep 17 00:00:00 2001 From: co63oc Date: Sun, 25 May 2025 10:01:40 +0800 Subject: [PATCH] Fix --- test/legacy_test/test_isin.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/legacy_test/test_isin.py b/test/legacy_test/test_isin.py index b610dd73c95c9f..367eec7bb76f52 100644 --- a/test/legacy_test/test_isin.py +++ b/test/legacy_test/test_isin.py @@ -64,6 +64,10 @@ }, ] +DATA_CASES_ZERO_SIZE = [ + {'x_data': np.random.randn(8, 0), 'test_x_data': np.random.randn(4, 0)}, + {'x_data': np.random.randn(8, 0), 'test_x_data': np.random.randn(4, 1)}, +] DATA_TYPE = ['float32', 'float64', 'int32', 'int64'] @@ -320,5 +324,13 @@ def test_unique_invert(self): ) +class TestIsIn_ZeroSize(unittest.TestCase): + def test_without_gpu(self): + test(DATA_CASES_ZERO_SIZE, DATA_TYPE) + + def test_with_gpu(self): + test(DATA_CASES_ZERO_SIZE, DATA_TYPE, use_gpu=True) + + if __name__ == '__main__': unittest.main()