From 4bd08e3408aa50cc1d762a01eded1f6464291327 Mon Sep 17 00:00:00 2001 From: weixing02 Date: Thu, 31 May 2018 15:00:36 +0800 Subject: [PATCH] make test_layers right --- python/paddle/fluid/layers/nn.py | 2 +- python/paddle/fluid/tests/unittests/test_layers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index bc3a7708363..072679696b1 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 5ac51847880..63ae51c4f42 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)) -- GitLab