diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index bc3a77083631a87965161b35ded8f7a0e75b623f..072679696b1b2565643be9a5597696bd10cff275 100644 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -3031,7 +3031,7 @@ def hsigmoid(input, label, num_classes=2, param_attr=None, bias_attr=None): raise ValueError("num_classes must be lager or equal than 2.") if input.shape[0] != label.shape[1]: raise ValueError( - "input's 1-st dimension and label's 2-nd dimension must be equal they both equal to batch size." + "input's 1-st dimension and label's 2-nd dimension must be equal, they both equal to batch size." ) weights = helper.create_parameter( attr=helper.param_attr, diff --git a/python/paddle/fluid/tests/unittests/test_layers.py b/python/paddle/fluid/tests/unittests/test_layers.py index 5ac518478804350f46ad8bccb40e8a8d043d07f8..63ae51c4f423373c4d695812cfced00408695937 100644 --- a/python/paddle/fluid/tests/unittests/test_layers.py +++ b/python/paddle/fluid/tests/unittests/test_layers.py @@ -177,7 +177,7 @@ class TestBook(unittest.TestCase): program = Program() with program_guard(program): x = layers.data(name='x', shape=[2, 2], dtype='float32') - y = layers.data(name='y', shape=[1, 3], dtype='int64') + y = layers.data(name='y', shape=[1, 2], dtype='int64') self.assertIsNotNone( layers.hsigmoid( input=x, label=y, num_classes=2))