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 3032dc5810dd6580fe169d00edc1c55c4f7830a9..0c2ad7517edda5c74b28500cf43cf15239829b7d 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