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

Update test_cross_entropy_loss.py

上级 6cd41cec
...@@ -1208,7 +1208,7 @@ class CrossEntropyLoss(unittest.TestCase): ...@@ -1208,7 +1208,7 @@ class CrossEntropyLoss(unittest.TestCase):
self.assertIsNotNone(static_ret) self.assertIsNotNone(static_ret)
with fluid.dygraph.guard(): with fluid.dygraph.guard():
cross_entropy_loss = paddle.nn.loss.CrossEntropyLoss( cross_entropy_loss = paddle.nn.loss.CrossEntropyLoss(
weight=fluid.dygraph.to_variable(weight_np), reduction='mean') weight=fluid.dygraph.to_variable(weight_np), reduction='mean', axis=1)
dy_ret = cross_entropy_loss( dy_ret = cross_entropy_loss(
fluid.dygraph.to_variable(input_np), fluid.dygraph.to_variable(input_np),
fluid.dygraph.to_variable(label_np)) fluid.dygraph.to_variable(label_np))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册