未验证 提交 a4b67f78 编写于 作者: F Feng Xing 提交者: GitHub

re-submit softmax_with_cross_entropy hard label (#35283)

上级 966f042d
......@@ -142,7 +142,10 @@ class TestParallelMarginSoftmaxCrossEntropyOp(unittest.TestCase):
return_softmax=True)
np.testing.assert_allclose(
loss_a.numpy(), loss_b.numpy(), rtol=1e-5)
loss_a.numpy(),
loss_b.numpy(),
rtol=1e-5,
atol=1e-7)
integral_prob = np.zeros(
(batch_size, num_class), dtype=dtype)
......@@ -181,7 +184,8 @@ class TestParallelMarginSoftmaxCrossEntropyOp(unittest.TestCase):
np.testing.assert_allclose(
integral_data.grad.numpy(),
integral_grad.numpy(),
rtol=1e-5)
rtol=1e-5,
atol=1e-7)
if __name__ == '__main__':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册