提交 7afd7f3d 编写于 作者: H HydrogenSulfate 提交者: chajchaj

Update test_cross_entropy_loss.py

上级 f6dc4b6b
......@@ -851,8 +851,7 @@ class CrossEntropyLoss(unittest.TestCase):
with fluid.dygraph.guard():
cross_entropy_loss = paddle.nn.loss.CrossEntropyLoss(
weight=fluid.dygraph.to_variable(weight_np),
ignore_index=255)
weight=fluid.dygraph.to_variable(weight_np), ignore_index=255)
dy_ret = cross_entropy_loss(
fluid.dygraph.to_variable(input_np),
fluid.dygraph.to_variable(label_np))
......@@ -1189,8 +1188,7 @@ class CrossEntropyLoss(unittest.TestCase):
weight_np = np.random.random([C]).astype(self.dtype)
with fluid.dygraph.guard():
cross_entropy_loss = paddle.nn.loss.CrossEntropyLoss(
weight=fluid.dygraph.to_variable(weight_np),
ignore_index=255)
weight=fluid.dygraph.to_variable(weight_np), ignore_index=255)
dy_ret = cross_entropy_loss(
fluid.dygraph.to_variable(input_np),
fluid.dygraph.to_variable(label_np))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册