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 6a037ad6be7c559499c147422819b75fbc4332e7..f99c3b2129b1a9a68fb65d03d6de40736a96d3e8 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)