              input_tensor = tf.transpose(input_tensor, (0, 2, 3, 1))
          return input_tensor
  
      def get_config(self):
          config = {"scale_factor": self.scale_factor,
                    "data_format": self.data_format}
          base_config = super(SubPixelUpscaling, self).get_config()
          return dict(list(base_config.items()) + list(config.items()))
 
</s> remove             # TF uses the last dimension as channel dimension,
            # instead of the 2nd one.
            # TH input shape: (samples, input_depth, rows, cols)
            # TF input shape: (samples, rows, cols, input_depth)
            x = tf.transpose(x, (0, 2, 3, 1))
        return x
 </s> add             # Tensorflow uses the last dimension as channel dimension, instead of the 2nd one.
            # Theano input shape: (samples, input_depth, rows, cols)
            # Tensorflow input shape: (samples, rows, cols, input_depth)
            input_tensor = tf.transpose(input_tensor, (0, 2, 3, 1))
        return input_tensor </s> remove         config = {'size': self.size,
                  'data_format': self.data_format}
        base_config = super(PixelShuffler, self).get_config()

        return dict(list(base_config.items()) + list(config.items()))
 </s> add         """Returns the config of the layer. </s> remove         # Compatibility with TensorFlow >= 1.0.0
        self.gamma = K.variable(self.gamma_init((1,)), name='{}_gamma'.format(self.name))
        self.trainable_weights = [self.gamma]

        if self.initial_weights is not None:
            self.set_weights(self.initial_weights)
            del self.initial_weights

    def call(self, x, mask=None):
        return self.gamma * x
 </s> add         Returns
        --------
        dict
            A python dictionary containing the layer configuration
        """
        config = {'size': self.size,
                  'data_format': self.data_format}
        base_config = super(PixelShuffler, self).get_config() </s> remove     def get_config(self):
        config = {"axis": self.axis}
        base_config = super(Scale, self).get_config()
 </s> add  </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)
        """Returns the config of the layer.

        A layer config is a Python dictionary (serializable) containing the configuration of a
        layer. The same layer can be reinstated later (without its trained weights) from this
        configuration.

        The configuration of a layer does not include connectivity information, nor the layer
        class name. These are handled by `Network` (one layer of abstraction above).

        Returns
        --------
        dict
            A python dictionary containing the layer configuration
        """
              input_tensor = tf.transpose(input_tensor, (0, 2, 3, 1))
          return input_tensor
  
      def get_config(self):
        """Returns the config of the layer.

        A layer config is a Python dictionary (serializable) containing the configuration of a
        layer. The same layer can be reinstated later (without its trained weights) from this
        configuration.

        The configuration of a layer does not include connectivity information, nor the layer
        class name. These are handled by `Network` (one layer of abstraction above).

        Returns
        --------
        dict
            A python dictionary containing the layer configuration
        """
          config = {"scale_factor": self.scale_factor,
                    "data_format": self.data_format}
          base_config = super(SubPixelUpscaling, self).get_config()
          return dict(list(base_config.items()) + list(config.items()))
keep keep keep add 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/layers.py