提交 9cdf6bd6 编写于 作者: R root 提交者: chajchaj

add ignore_index for test case

上级 94952111
......@@ -1375,7 +1375,10 @@ class TestCrossEntropyFAPIError(unittest.TestCase):
label_data[0] = 255
weight_data = paddle.rand([100])
paddle.nn.functional.cross_entropy(
input=input_data, label=label_data, weight=weight_data)
input=input_data,
label=label_data,
weight=weight_data,
ignore_index=0)
self.assertRaises(ValueError, test_LabelValue)
......@@ -1386,7 +1389,10 @@ class TestCrossEntropyFAPIError(unittest.TestCase):
label_data[0] = -1
weight_data = paddle.rand([100])
paddle.nn.functional.cross_entropy(
input=input_data, label=label_data, weight=weight_data)
input=input_data,
label=label_data,
weight=weight_data,
ignore_index=0)
self.assertRaises(ValueError, test_LabelValueNeg)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册