|
|
@ -58,7 +58,8 @@ class ImageGradients(Cell):
|
|
|
|
super(ImageGradients, self).__init__()
|
|
|
|
super(ImageGradients, self).__init__()
|
|
|
|
|
|
|
|
|
|
|
|
def construct(self, images):
|
|
|
|
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)
|
|
|
|
batch_size, depth, height, width = P.Shape()(images)
|
|
|
|
dy = images[:, :, 1:, :] - images[:, :, :height - 1, :]
|
|
|
|
dy = images[:, :, 1:, :] - images[:, :, :height - 1, :]
|
|
|
|
dy_last = P.Fill()(P.DType()(images), (batch_size, depth, 1, width), 0)
|
|
|
|
dy_last = P.Fill()(P.DType()(images), (batch_size, depth, 1, width), 0)
|
|
|
|