diff --git a/test/legacy_test/test_zero_dim_tensor.py b/test/legacy_test/test_zero_dim_tensor.py index 8b7cd294aa9182..1f9288f905aac0 100644 --- a/test/legacy_test/test_zero_dim_tensor.py +++ b/test/legacy_test/test_zero_dim_tensor.py @@ -2589,7 +2589,7 @@ def test_unbind(self): self.assertEqual(out2_2.numpy(), 2) self.assertEqual(x2.grad.shape, [2]) - def test_maseked_select(self): + def test_masked_select(self): x = paddle.rand([]) x.stop_gradient = False mask = paddle.full([], True, dtype='bool') @@ -4860,7 +4860,7 @@ def test_unbind(self): self.assertEqual(res[1].shape, (2,)) @prog_scope() - def test_maseked_select(self): + def test_masked_select(self): x = paddle.rand([]) x.stop_gradient = False mask = paddle.full([], True, dtype='bool') diff --git a/test/xpu/test_reduce_amin_op_xpu.py b/test/xpu/test_reduce_amin_op_xpu.py index ad1d643bb9703d..7c372d0bf6a1bd 100644 --- a/test/xpu/test_reduce_amin_op_xpu.py +++ b/test/xpu/test_reduce_amin_op_xpu.py @@ -45,10 +45,10 @@ def set_case(self): 'X': np.random.randint(0, 100, self.shape).astype("float32") } - expect_intput = self.inputs['X'] + expect_input = self.inputs['X'] self.outputs = { 'Out': np.amin( - expect_intput, + expect_input, axis=self.attrs['dim'], keepdims=self.attrs['keep_dim'], ) diff --git a/test/xpu/test_set_value_op_xpu.py b/test/xpu/test_set_value_op_xpu.py index 5526fcee30e67b..9f64a0c0cea8ad 100644 --- a/test/xpu/test_set_value_op_xpu.py +++ b/test/xpu/test_set_value_op_xpu.py @@ -308,7 +308,7 @@ def _get_answer(self): self.data[0:, 1:2:2, :] = self.value # 1.2.3 step < 0 - class XPUTestSetValueItemSliceNegetiveStep(XPUTestSetValueApi): + class XPUTestSetValueItemSliceNegativeStep(XPUTestSetValueApi): def set_dtype(self): if self.in_type == np.float16: self.dtype = "float32" @@ -333,8 +333,8 @@ def _call_setitem_static_api(self, x): def _get_answer(self): self.data[5:2:-1] = self.value - class XPUTestSetValueItemSliceNegetiveStep2( - XPUTestSetValueItemSliceNegetiveStep + class XPUTestSetValueItemSliceNegativeStep2( + XPUTestSetValueItemSliceNegativeStep ): def set_shape(self): self.shape = [5] @@ -353,8 +353,8 @@ def _call_setitem_static_api(self, x): def _get_answer(self): self.data[1::-1] = self.value - class XPUTestSetValueItemSliceNegetiveStep3( - XPUTestSetValueItemSliceNegetiveStep + class XPUTestSetValueItemSliceNegativeStep3( + XPUTestSetValueItemSliceNegativeStep ): def set_shape(self): self.shape = [3] @@ -372,7 +372,7 @@ def _call_setitem_static_api(self, x): def _get_answer(self): self.data[::-1] = self.value - class XPUTestSetValueItemSliceNegetiveStep4(XPUTestSetValueApi): + class XPUTestSetValueItemSliceNegativeStep4(XPUTestSetValueApi): def set_dtype(self): if self.in_type == np.float16: self.dtype = "float32" @@ -400,7 +400,7 @@ def _get_answer(self): # 1.2.3 step < 0 and stride < -1 - class XPUTestSetValueItemSliceNegetiveStep5(XPUTestSetValueApi): + class XPUTestSetValueItemSliceNegativeStep5(XPUTestSetValueApi): def set_dtype(self): if self.in_type == np.float16: self.dtype = "float32" @@ -1230,14 +1230,14 @@ def set_value(t, value): np.testing.assert_array_equal( inps.grad.numpy(), input_grad, - err_msg='The gradient of value should be \n{},\n but reveived {}'.format( + err_msg='The gradient of value should be \n{},\n but received {}'.format( input_grad, inps.grad.numpy() ), ) np.testing.assert_array_equal( value.grad.numpy(), value_grad, - err_msg='The gradient of input should be \n{},\n but reveived {}'.format( + err_msg='The gradient of input should be \n{},\n but received {}'.format( value_grad, value.grad.numpy() ), ) @@ -1266,14 +1266,14 @@ def set_value(t, value): np.testing.assert_array_equal( inps2.grad.numpy(), input_grad2, - err_msg='The gradient of value should be \n{},\n but reveived {}'.format( + err_msg='The gradient of value should be \n{},\n but received {}'.format( input_grad, inps2.grad.numpy() ), ) np.testing.assert_array_equal( value2.grad.numpy(), value_grad2, - err_msg='The gradient of input should be \n{},\n but reveived {}'.format( + err_msg='The gradient of input should be \n{},\n but received {}'.format( value_grad, value2.grad.numpy() ), ) @@ -1324,14 +1324,14 @@ def set_value3(t, value): np.testing.assert_array_equal( inps.grad.numpy(), input_grad, - err_msg='The gradient of value should be \n{},\n but reveived {}'.format( + err_msg='The gradient of value should be \n{},\n but received {}'.format( input_grad, inps.grad.numpy() ), ) np.testing.assert_array_equal( value.grad.numpy(), value_grad, - err_msg='The gradient of input should be \n{},\n but reveived {}'.format( + err_msg='The gradient of input should be \n{},\n but received {}'.format( value_grad, value.grad.numpy() ), ) @@ -1372,14 +1372,14 @@ def set_value4(t, value): np.testing.assert_array_equal( inps.grad.numpy(), input_grad, - err_msg='The gradient of value should be \n{},\n but reveived {}'.format( + err_msg='The gradient of value should be \n{},\n but received {}'.format( input_grad, inps.grad.numpy() ), ) np.testing.assert_array_equal( value.grad.numpy(), value_grad, - err_msg='The gradient of input should be \n{},\n but reveived {}'.format( + err_msg='The gradient of input should be \n{},\n but received {}'.format( value_grad, value.grad.numpy() ), ) @@ -1426,14 +1426,14 @@ def set_value5(t, value): np.testing.assert_array_equal( inps.grad.numpy(), input_grad, - err_msg='The gradient of value should be \n{},\n but reveived {}'.format( + err_msg='The gradient of value should be \n{},\n but received {}'.format( input_grad, inps.grad.numpy() ), ) np.testing.assert_array_equal( value.grad.numpy(), value_grad, - err_msg='The gradient of input should be \n{},\n but reveived {}'.format( + err_msg='The gradient of input should be \n{},\n but received {}'.format( value_grad, value.grad.numpy() ), ) diff --git a/test/xpu/test_sum_op_xpu.py b/test/xpu/test_sum_op_xpu.py index f582d6322362b3..addb047ba6343c 100644 --- a/test/xpu/test_sum_op_xpu.py +++ b/test/xpu/test_sum_op_xpu.py @@ -213,7 +213,7 @@ def setUp(self): self.init_kernel_type() def check_with_place(self, place, inplace): - self.check_input_and_optput(place, inplace, True, True, True) + self.check_input_and_output(place, inplace, True, True, True) def init_kernel_type(self): pass @@ -224,7 +224,7 @@ def _get_array(self, rows, row_numel): array[i] *= rows[i] return array - def check_input_and_optput( + def check_input_and_output( self, place, inplace, diff --git a/test/xpu/test_zero_dim_tensor_xpu.py b/test/xpu/test_zero_dim_tensor_xpu.py index a836e2e7fb58ed..e872a31a1622f6 100644 --- a/test/xpu/test_zero_dim_tensor_xpu.py +++ b/test/xpu/test_zero_dim_tensor_xpu.py @@ -2127,7 +2127,7 @@ def test_unbind(self): self.assertEqual(out2_2.numpy(), 2) self.assertEqual(x2.grad.shape, [2]) - def test_maseked_select(self): + def test_masked_select(self): x = paddle.rand([]) x.stop_gradient = False mask = paddle.full([], True, dtype='bool')