diff --git a/test/dygraph_to_static/seq2seq_dygraph_model.py b/test/dygraph_to_static/seq2seq_dygraph_model.py index d2488c31b0ddb0..2359a7df502399 100644 --- a/test/dygraph_to_static/seq2seq_dygraph_model.py +++ b/test/dygraph_to_static/seq2seq_dygraph_model.py @@ -41,7 +41,7 @@ def __init__( ): super().__init__(dtype) - self._hiden_size = hidden_size + self._hidden_size = hidden_size self._param_attr = param_attr self._bias_attr = bias_attr self._gate_activation = gate_activation or paddle.nn.functional.sigmoid @@ -52,13 +52,13 @@ def __init__( self._weight = self.create_parameter( attr=self._param_attr, - shape=[self._input_size + self._hiden_size, 4 * self._hiden_size], + shape=[self._input_size + self._hidden_size, 4 * self._hidden_size], dtype=self._dtype, ) self._bias = self.create_parameter( attr=self._bias_attr, - shape=[4 * self._hiden_size], + shape=[4 * self._hidden_size], dtype=self._dtype, is_bias=True, ) diff --git a/test/dygraph_to_static/test_fallback.py b/test/dygraph_to_static/test_fallback.py index 25a89da29fc9c5..aca2cdbb507cec 100644 --- a/test/dygraph_to_static/test_fallback.py +++ b/test/dygraph_to_static/test_fallback.py @@ -36,7 +36,7 @@ def unsupport_func(x): return paddle.to_tensor(t) -class SuppportNet(paddle.nn.Layer): +class SupportNet(paddle.nn.Layer): def __init__(self): super().__init__() @@ -44,7 +44,7 @@ def forward(self, x): return support_func(x) -class UnsuppportNet(paddle.nn.Layer): +class UnsupportNet(paddle.nn.Layer): def __init__(self): super().__init__() @@ -76,8 +76,8 @@ def test_case_func_fallback(self): np.testing.assert_allclose(output.numpy(), unsupport_func(self.x)) def test_case_net_fallback(self): - s_net = SuppportNet() - u_net = UnsuppportNet() + s_net = SupportNet() + u_net = UnsupportNet() np.testing.assert_allclose( paddle.jit.to_static(s_net)(self.x).numpy(), 4 ) @@ -92,8 +92,8 @@ def test_case_net_fallback(self): @test_ast_only def test_case_net_error(self): - s_net = SuppportNet() - u_net = UnsuppportNet() + s_net = SupportNet() + u_net = UnsupportNet() np.testing.assert_allclose( paddle.jit.to_static(s_net)(self.x).numpy(), 4 ) @@ -111,7 +111,7 @@ def test_case_training(self): build_strategy = paddle.static.BuildStrategy() build_strategy.build_cinn_pass = True u_net = paddle.jit.to_static( - UnsuppportNet(), build_strategy=build_strategy + UnsupportNet(), build_strategy=build_strategy ) u_net.eval() np.testing.assert_allclose(u_net(self.x).numpy(), [1, 1]) @@ -122,7 +122,7 @@ def test_case_save_error(self): """ test the save will raise error. """ - u_net = UnsuppportNet() + u_net = UnsupportNet() u_net = paddle.jit.to_static( u_net, input_spec=[paddle.static.InputSpec(name='x', shape=[1])] ) @@ -133,7 +133,7 @@ def test_case_save_error_2(self): """ test the save will raise error. """ - u_net = UnsuppportNet() + u_net = UnsupportNet() build_strategy = paddle.static.BuildStrategy() build_strategy.build_cinn_pass = True u_net = paddle.jit.to_static(u_net, build_strategy=build_strategy)