未验证 提交 e74f287b 编写于 作者: G Guoxia Wang 提交者: GitHub

fix the unittest bug of none grad of margin_cross_entropy when...

fix the unittest bug of none grad of margin_cross_entropy when FLAGS_retain_grad_for_all_tensor change default setting (#43241)
上级 55280837
...@@ -39,6 +39,7 @@ class TestParallelMarginSoftmaxCrossEntropyOp(unittest.TestCase): ...@@ -39,6 +39,7 @@ class TestParallelMarginSoftmaxCrossEntropyOp(unittest.TestCase):
def setUp(self): def setUp(self):
strategy = fleet.DistributedStrategy() strategy = fleet.DistributedStrategy()
fleet.init(is_collective=True, strategy=strategy) fleet.init(is_collective=True, strategy=strategy)
paddle.fluid.set_flags({"FLAGS_retain_grad_for_all_tensor": True})
def test_parallel_margin_softmax_cross_entropy(self): def test_parallel_margin_softmax_cross_entropy(self):
margin1s = [1.0, 1.0, 1.35] margin1s = [1.0, 1.0, 1.35]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册