From a5c021f450f7785dca717b183a8cfdd6b137a101 Mon Sep 17 00:00:00 2001 From: zhaozhenlong Date: Fri, 22 May 2020 10:14:42 +0800 Subject: [PATCH] smoothL1Loss grad wrt target --- mindspore/ops/_grad/grad_nn_ops.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mindspore/ops/_grad/grad_nn_ops.py b/mindspore/ops/_grad/grad_nn_ops.py index c55730128..b5a0fb3bd 100755 --- a/mindspore/ops/_grad/grad_nn_ops.py +++ b/mindspore/ops/_grad/grad_nn_ops.py @@ -502,7 +502,8 @@ def get_bprop_smooth_l1_loss(self): def bprop(prediction, target, out, dout): dx = grad(prediction, target, dout) - return dx, zeros_like(target) + dy = grad(target, prediction, dout) + return dx, dy return bprop -- GitLab