提交 ee070fbd 编写于 作者: H HydrogenSulfate 提交者: chajchaj

Update test_cross_entropy_loss.py

上级 7afd7f3d
......@@ -1404,34 +1404,6 @@ class TestCrossEntropyFAPIError(unittest.TestCase):
def test_errors(self):
with program_guard(Program(), Program()):
# def test_LabelValue():
# input_data = paddle.rand(shape=[20, 100])
# label_data = paddle.randint(
# 0, 100, shape=[20, 1], dtype="int64")
# label_data[0] = 255
# weight_data = paddle.rand([100])
# paddle.nn.functional.cross_entropy(
# input=input_data,
# label=label_data,
# weight=weight_data,
# ignore_index=255)
# self.assertRaises(ValueError, test_LabelValue)
# def test_LabelValueNeg():
# input_data = paddle.rand(shape=[20, 100])
# label_data = paddle.randint(
# 0, 100, shape=[20, 1], dtype="int64")
# label_data[0] = -1
# weight_data = paddle.rand([100])
# paddle.nn.functional.cross_entropy(
# input=input_data,
# label=label_data,
# weight=weight_data,
# ignore_index=-1)
# self.assertRaises(ValueError, test_LabelValueNeg)
def test_WeightLength_NotEqual():
input_data = paddle.rand(shape=[20, 100])
label_data = paddle.randint(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册