      static_image_shape = image.get_shape()
      image_shape = K.shape(image)
  
      # 5x5 modified Scharr kernel ( reshape to (5,5,1,2) )
      matrix = [[[[0.00070, 0.00070]],
                 [[0.00520, 0.00370]],
                 [[0.03700, 0.00000]],
                 [[0.00520, -0.0037]],
                 [[0.00070, -0.0007]]],
                [[[0.00370, 0.00520]],
                 [[0.11870, 0.11870]],
                 [[0.25890, 0.00000]],
                 [[0.11870, -0.1187]],
                 [[0.00370, -0.0052]]],
                [[[0.00000, 0.03700]],
                 [[0.00000, 0.25890]],
                 [[0.00000, 0.00000]],
                 [[0.00000, -0.2589]],
                 [[0.00000, -0.0370]]],
                [[[-0.0037, 0.00520]],
                 [[-0.1187, 0.11870]],
                 [[-0.2589, 0.00000]],
                 [[-0.1187, -0.1187]],
                 [[-0.0037, -0.0052]]],
                [[[-0.0007, 0.00070]],
                 [[-0.0052, 0.00370]],
                 [[-0.0370, 0.00000]],
                 [[-0.0052, -0.0037]],
                 [[-0.0007, -0.0007]]]]
      num_kernels = [2]
      kernels = K.constant(matrix, dtype='float32')
      kernels = K.tile(kernels, [1, 1, image_shape[-1], 1])
  
      # Use depth-wise convolution to calculate edge maps per channel.
 
</s> remove     static_image_shape = image.get_shape()
 </s> add     static_image_shape = image.shape.dims if get_backend() == "amd" else image.get_shape() </s> remove     padded = tf.pad(image, pad_sizes, mode='REFLECT')
 </s> add     padded = pad(image, pad_sizes, mode='REFLECT') </s> remove     """
    Returns a tensor holding modified Scharr edge maps.
    Arguments:
    image: Image tensor with shape [batch_size, h, w, d] and type float32.
    The image(s) must be 2x2 or larger.
    magnitude: Boolean to determine if the edge magnitude or edge direction is returned
    Returns:
    Tensor holding edge maps for each channel. Returns a tensor with shape
    [batch_size, h, w, d, 2] where the last two dimensions hold [[dy[0], dx[0]],
    [dy[1], dx[1]], ..., [dy[d-1], dx[d-1]]] calculated using the Scharr filter.
 </s> add     """ Returns a tensor holding modified Scharr edge maps.

    Parameters
    ----------
    image: tensor
        Image tensor with shape [batch_size, h, w, d] and type float32. The image(s) must be 2x2
        or larger.
    magnitude: bool
        Boolean to determine if the edge magnitude or edge direction is returned

    Returns
    -------
    tensor
        Tensor holding edge maps for each channel. Returns a tensor with shape `[batch_size, h, w,
        d, 2]` where the last two dimensions hold `[[dy[0], dx[0]], [dy[1], dx[1]], ..., [dy[d-1],
        dx[d-1]]]` calculated using the Scharr filter. </s> remove             x = K.permute_dimensions(x, (0, 2, 3, 1))
        patches = extract_image_patches(x, kernel, strides, [1, 1, 1, 1], padding)
 </s> add             input_tensor = K.permute_dimensions(input_tensor, (0, 2, 3, 1))
        patches = extract_image_patches(input_tensor, kernel, strides, [1, 1, 1, 1], padding) </s> remove         kernel = [1, ksizes[0], ksizes[1], 1]
        strides = [1, ssizes[0], ssizes[1], 1]
 </s> add         kernel = [1, k_sizes[0], k_sizes[1], 1]
        strides = [1, s_sizes[0], s_sizes[1], 1]
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
      static_image_shape = image.get_shape()
      image_shape = K.shape(image)
  
      # 5x5 modified Scharr kernel ( reshape to (5,5,1,2) )
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
    matrix = np.array([[[[0.00070, 0.00070]],
                        [[0.00520, 0.00370]],
                        [[0.03700, 0.00000]],
                        [[0.00520, -0.0037]],
                        [[0.00070, -0.0007]]],
                       [[[0.00370, 0.00520]],
                        [[0.11870, 0.11870]],
                        [[0.25890, 0.00000]],
                        [[0.11870, -0.1187]],
                        [[0.00370, -0.0052]]],
                       [[[0.00000, 0.03700]],
                        [[0.00000, 0.25890]],
                        [[0.00000, 0.00000]],
                        [[0.00000, -0.2589]],
                        [[0.00000, -0.0370]]],
                       [[[-0.0037, 0.00520]],
                        [[-0.1187, 0.11870]],
                        [[-0.2589, 0.00000]],
                        [[-0.1187, -0.1187]],
                        [[-0.0037, -0.0052]]],
                       [[[-0.0007, 0.00070]],
                        [[-0.0052, 0.00370]],
                        [[-0.0370, 0.00000]],
                        [[-0.0052, -0.0037]],
                        [[-0.0007, -0.0007]]]])
      num_kernels = [2]
      kernels = K.constant(matrix, dtype='float32')
      kernels = K.tile(kernels, [1, 1, image_shape[-1], 1])
  
      # Use depth-wise convolution to calculate edge maps per channel.
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Simple backend unit tests (#1020)

* Add simple backend tests for lib.model
* Document lib.model
* Fix GMSD Loss for AMD
* Remove obsolete code from lib.model 
lib/model/losses.py