From a34d85d9be073648c4e34ff8aba507203d09c2ee Mon Sep 17 00:00:00 2001 From: mjxs <52824616+kk-2000@users.noreply.github.com> Date: Tue, 31 Jan 2023 10:31:30 +0800 Subject: [PATCH] np.unicode_ => np.str_ (#49975) --- .../fluid/tests/unittests/test_egr_string_tensor_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_egr_string_tensor_api.py b/python/paddle/fluid/tests/unittests/test_egr_string_tensor_api.py index 3032dc5810..0c2ad7517e 100644 --- a/python/paddle/fluid/tests/unittests/test_egr_string_tensor_api.py +++ b/python/paddle/fluid/tests/unittests/test_egr_string_tensor_api.py @@ -41,7 +41,7 @@ class EagerStringTensorTestCase(unittest.TestCase): self.assertEqual(ST2.name, "ST2") self.assertEqual(ST2.shape, shape) np.testing.assert_array_equal( - ST2.numpy(), np.empty(shape, dtype=np.unicode_) + ST2.numpy(), np.empty(shape, dtype=np.str_) ) ST3 = core.eager.StringTensor(self.str_arr, "ST3") # constructor 3 @@ -74,7 +74,7 @@ class EagerStringTensorTestCase(unittest.TestCase): self.assertEqual(ST1.name, "ST1") self.assertEqual(ST1.shape, shape) np.testing.assert_array_equal( - ST1.numpy(), np.empty(shape, dtype=np.unicode_) + ST1.numpy(), np.empty(shape, dtype=np.str_) ) ST2 = core.eager.StringTensor(self.str_arr, name="ST2") # constructor 3 -- GitLab