未验证 提交 1fab8908 编写于 作者: J jiaqianjing 提交者: GitHub

update for ranking_loss #46302 (#46306)

上级 f925d1dc
......@@ -1159,8 +1159,9 @@ def margin_ranking_loss(input,
check_variable_and_dtype(label, 'label', ['float32', 'float64'],
'margin_rank_loss')
out = paddle.subtract(other, input)
out = paddle.multiply(out, label)
out = paddle.subtract(input, other)
neg_label = paddle.neg(label)
out = paddle.multiply(neg_label, out)
if margin != 0.0:
margin_var = out.block.create_var(dtype=out.dtype)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册