提交 6cd96c19 编写于 作者: R root 提交者: chajchaj

fix ci coverage

上级 e2c293f6
......@@ -1377,6 +1377,15 @@ class TestCrossEntropyFAPIError(unittest.TestCase):
self.assertRaises(ValueError, test_LabelValue)
def test_LabelValueNeg():
input_data = paddle.rand(shape=[20, 100])
label_data = paddle.randint(0, 100, shape=[5, 1], dtype="int64")
label_data[0] = -1
paddle.nn.functional.cross_entropy(
input=input_data, label=label_data)
self.assertRaises(ValueError, test_LabelValueNeg)
if __name__ == "__main__":
unittest.main()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册