Browse Source

!1001 fix issue Conv2dBackpropInput bprop should return 3 instead of 2 items

Merge pull request !1001 from zhaozhenlong/conv2d-bp-input-grad-output-3
tags/v0.3.0-alpha
mindspore-ci-bot Gitee 5 years ago
parent
commit
eed6daf807
2 changed files with 3 additions and 2 deletions
  1. +2
    -1
      mindspore/nn/layer/image.py
  2. +1
    -1
      mindspore/ops/_grad/grad_nn_ops.py

+ 2
- 1
mindspore/nn/layer/image.py View File

@@ -58,7 +58,8 @@ class ImageGradients(Cell):
super(ImageGradients, self).__init__()

def construct(self, images):
_check_input_4d(F.shape(images), "images", self.cls_name)
check = _check_input_4d(F.shape(images), "images", self.cls_name)
images = F.depend(images, check)
batch_size, depth, height, width = P.Shape()(images)
dy = images[:, :, 1:, :] - images[:, :, :height - 1, :]
dy_last = P.Fill()(P.DType()(images), (batch_size, depth, 1, width), 0)


+ 1
- 1
mindspore/ops/_grad/grad_nn_ops.py View File

@@ -627,7 +627,7 @@ def get_bprop_conv2d_backprop_input(self):
def bprop(x, w, f_sizes, out, dout):
dx = input_grad(dout, w)
dw = filter_grad(x, dout, F.shape(w))
return dx, dw
return dx, dw, zeros_like(f_sizes)

return bprop



Loading…
Cancel
Save