提交 4bd08e34 编写于 作者: W weixing02

make test_layers right

上级 57c09329
......@@ -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,
......
......@@ -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))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册