From 7afd7f3d70d5201274305cf3cac7ddf957fae7af Mon Sep 17 00:00:00 2001 From: HydrogenSulfate <490868991@qq.com> Date: Mon, 16 Aug 2021 00:34:34 +0800 Subject: [PATCH] Update test_cross_entropy_loss.py --- .../paddle/fluid/tests/unittests/test_cross_entropy_loss.py | 6 ++---- 1 file changed, 2 insertions(+), 4 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 650c71f4c58..6a6106f1165 100644 --- a/python/paddle/fluid/tests/unittests/test_cross_entropy_loss.py +++ b/python/paddle/fluid/tests/unittests/test_cross_entropy_loss.py @@ -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)) -- GitLab