              The (k_w, k_h) patches extracted
              TF ==> (batch_size, w, h, k_w, k_h, c)
              TH ==> (batch_size, w, h, c, k_w, k_h)
          """
          kernel = [1, ksizes[0], ksizes[1], 1]
          strides = [1, ssizes[0], ssizes[1], 1]
          padding = self._preprocess_padding(padding)
          if data_format == 'channels_first':
              x = K.permute_dimensions(x, (0, 2, 3, 1))
          patches = extract_image_patches(x, kernel, strides, [1, 1, 1, 1], padding)
          return patches
 
</s> remove     def extract_image_patches(self, x, ksizes, ssizes, padding='same',
                              data_format='channels_last'):
        """
        Extract the patches from an image
        # Parameters
            x : The input image
            ksizes : 2-d tuple with the kernel size
            ssizes : 2-d tuple with the strides size
            padding : 'same' or 'valid'
            data_format : 'channels_last' or 'channels_first'
        # Returns
            The (k_w, k_h) patches extracted
            TF ==> (batch_size, w, h, k_w, k_h, c)
            TH ==> (batch_size, w, h, c, k_w, k_h)
 </s> add     def extract_image_patches(self, input_tensor, k_sizes, s_sizes,
                              padding='same', data_format='channels_last'):
        """ Extract the patches from an image.

        Parameters
        ----------
        input_tensor: tensor
            The input image
        k_sizes: tuple
            2-d tuple with the kernel size
        s_sizes: tuple
            2-d tuple with the strides size
        padding: str, optional
            `"same"` or `"valid"`. Default: `"same"`
        data_format: str, optional.
            `"channels_last"` or `"channels_first"`. Default: `"channels_last"`

        Returns
        -------
        The (k_w, k_h) patches extracted
            Tensorflow ==> (batch_size, w, h, k_w, k_h, c)
            Theano ==> (batch_size, w, h, c, k_w, k_h) </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             out = K.reshape(out, (batch_size, oh, ow, oc))
 </s> add             out = K.reshape(out, (batch_size, o_height, o_width, o_channels)) </s> remove             rh, rw = self.size
            oh, ow = h * rh, w * rw
            oc = c // (rh * rw)
 </s> add             r_height, r_width = self.size
            o_height, o_width = height * r_height, width * r_width
            o_channels = channels // (r_height * r_width) </s> remove             out = K.reshape(out, (batch_size, oc, oh, ow))
 </s> add             out = K.reshape(out, (batch_size, o_channels, o_height, o_width))
        kernel = [1, k_sizes[0], k_sizes[1], 1]
        strides = [1, s_sizes[0], s_sizes[1], 1]
              The (k_w, k_h) patches extracted
              TF ==> (batch_size, w, h, k_w, k_h, c)
              TH ==> (batch_size, w, h, c, k_w, k_h)
          """
        kernel = [1, k_sizes[0], k_sizes[1], 1]
        strides = [1, s_sizes[0], s_sizes[1], 1]
        kernel = [1, k_sizes[0], k_sizes[1], 1]
        strides = [1, s_sizes[0], s_sizes[1], 1]
          padding = self._preprocess_padding(padding)
          if data_format == 'channels_first':
              x = K.permute_dimensions(x, (0, 2, 3, 1))
          patches = extract_image_patches(x, kernel, strides, [1, 1, 1, 1], padding)
          return patches
keep keep keep keep 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