From e1ea895fd4b113c9f91752c03d8c6e35176ec672 Mon Sep 17 00:00:00 2001 From: root <12272008@bjtu.edu.cn> Date: Tue, 27 Apr 2021 11:52:59 +0000 Subject: [PATCH] fix ci coverage bug --- .../paddle/fluid/tests/unittests/test_cross_entropy_loss.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_cross_entropy_loss.py b/python/paddle/fluid/tests/unittests/test_cross_entropy_loss.py index 6a037ad6be7..f99c3b2129b 100644 --- a/python/paddle/fluid/tests/unittests/test_cross_entropy_loss.py +++ b/python/paddle/fluid/tests/unittests/test_cross_entropy_loss.py @@ -1370,7 +1370,8 @@ class TestCrossEntropyFAPIError(unittest.TestCase): def test_LabelValue(): input_data = paddle.rand(shape=[20, 100]) - label_data = paddle.randint(0, 100, shape=[5, 1], dtype="int64") + label_data = paddle.randint( + 0, 100, shape=[20, 1], dtype="int64") label_data[0] = 255 paddle.nn.functional.cross_entropy( input=input_data, label=label_data) @@ -1379,7 +1380,8 @@ class TestCrossEntropyFAPIError(unittest.TestCase): def test_LabelValueNeg(): input_data = paddle.rand(shape=[20, 100]) - label_data = paddle.randint(0, 100, shape=[5, 1], dtype="int64") + label_data = paddle.randint( + 0, 100, shape=[20, 1], dtype="int64") label_data[0] = -1 paddle.nn.functional.cross_entropy( input=input_data, label=label_data) -- GitLab