          return var_x
  
      def upscale(self, inp, filters, kernel_size=3, padding="same",
                  use_instance_norm=False, res_block_follows=False, scale_factor=2, **kwargs):
          """ Upscale Layer """
          logger.debug("inp: %s, filters: %s, kernel_size: %s, use_instance_norm: %s, kwargs: %s)",
                       inp, filters, kernel_size, use_instance_norm, kwargs)
          name = self.get_name("upscale_{}".format(inp.shape[1]))
          if self.use_reflect_padding:
              inp = ReflectionPadding2D(stride=1,
                                        kernel_size=kernel_size,
                                        name="{}_reflectionpadding2d".format(name))(inp)
              padding = "valid"
 
</s> remove     def upscale(self, inp, filters, kernel_size=3, padding="same",
 </s> add     def upscale(self, input_tensor, filters, kernel_size=3, padding="same", </s> remove             inp = ReflectionPadding2D(stride=1,
                                      kernel_size=kernel_size,
                                      name="{}_reflectionpadding2d".format(name))(inp)
 </s> add             input_tensor = ReflectionPadding2D(
                stride=1,
                kernel_size=kernel_size,
                name="{}_reflectionpadding2d".format(name))(input_tensor) </s> remove             inp = ReflectionPadding2D(stride=strides,
                                      kernel_size=kernel_size,
                                      name="{}_reflectionpadding2d".format(name))(inp)
 </s> add             input_tensor = ReflectionPadding2D(
                stride=strides,
                kernel_size=kernel_size,
                name="{}_reflectionpadding2d".format(name))(input_tensor) </s> remove     def conv(self, inp, filters, kernel_size=5, strides=2, padding="same",
 </s> add     def conv(self, input_tensor, filters, kernel_size=5, strides=2, padding="same", </s> remove     def res_block(self, inp, filters, kernel_size=3, padding="same", **kwargs):
        """ Residual block """
        logger.debug("inp: %s, filters: %s, kernel_size: %s, kwargs: %s)",
                     inp, filters, kernel_size, kwargs)
        name = self.get_name("residual_{}".format(inp.shape[1]))
        var_x = LeakyReLU(alpha=0.2, name="{}_leakyrelu_0".format(name))(inp)
 </s> add     def res_block(self, input_tensor, filters, kernel_size=3, padding="same", **kwargs):
        """ Residual block.

        Parameters
        ----------
        input_tensor: tensor
            The input tensor to the layer
        filters: int
            The dimensionality of the output space (i.e. the number of output filters in the
            convolution)
        kernel_size: int, optional
            An integer or tuple/list of 2 integers, specifying the height and width of the 2D
            convolution window. Can be a single integer to specify the same value for all spatial
            dimensions. Default: 3
        padding: ["valid", "same"], optional
            The padding to use. Default: `"same"`
        kwargs: dict
            Any additional Keras standard layer keyword arguments

        Returns
        -------
        tensor
            The output tensor from the Upscale layer
        """
        logger.debug("input_tensor: %s, filters: %s, kernel_size: %s, kwargs: %s)",
                     input_tensor, filters, kernel_size, kwargs)
        name = self._get_name("residual_{}".format(input_tensor.shape[1]))
        var_x = LeakyReLU(alpha=0.2, name="{}_leakyrelu_0".format(name))(input_tensor)
        """ An upscale layer for sub-pixel up-scaling.

        Adds reflection padding if it has been selected by the user, and other post-processing
        if requested by the plugin.

        Parameters
        ----------
        input_tensor: tensor
            The input tensor to the layer
        filters: int
            The dimensionality of the output space (i.e. the number of output filters in the
            convolution)
        kernel_size: int, optional
            An integer or tuple/list of 2 integers, specifying the height and width of the 2D
            convolution window. Can be a single integer to specify the same value for all spatial
            dimensions. Default: 3
        padding: ["valid", "same"], optional
            The padding to use. Default: `"same"`
        use_instance_norm: bool, optional
            ``True`` if instance normalization should be applied after the convolutional layer.
            Default: ``False``
        res_block_follows: bool, optional
            If a residual block will follow this layer, then this should be set to `True` to add
            a leaky ReLu after the convolutional layer. Default: ``False``
        scale_factor: int, optional
            The amount to upscale the image. Default: `2`
        kwargs: dict
            Any additional Keras standard layer keyword arguments

        Returns
        -------
        tensor
            The output tensor from the Upscale layer
        """
        logger.debug("input_tensor: %s, filters: %s, kernel_size: %s, use_instance_norm: %s, "
                     "kwargs: %s)", input_tensor, filters, kernel_size, use_instance_norm, kwargs)
        name = self._get_name("upscale_{}".format(input_tensor.shape[1]))
          return var_x
  
      def upscale(self, inp, filters, kernel_size=3, padding="same",
                  use_instance_norm=False, res_block_follows=False, scale_factor=2, **kwargs):
        """ An upscale layer for sub-pixel up-scaling.

        Adds reflection padding if it has been selected by the user, and other post-processing
        if requested by the plugin.

        Parameters
        ----------
        input_tensor: tensor
            The input tensor to the layer
        filters: int
            The dimensionality of the output space (i.e. the number of output filters in the
            convolution)
        kernel_size: int, optional
            An integer or tuple/list of 2 integers, specifying the height and width of the 2D
            convolution window. Can be a single integer to specify the same value for all spatial
            dimensions. Default: 3
        padding: ["valid", "same"], optional
            The padding to use. Default: `"same"`
        use_instance_norm: bool, optional
            ``True`` if instance normalization should be applied after the convolutional layer.
            Default: ``False``
        res_block_follows: bool, optional
            If a residual block will follow this layer, then this should be set to `True` to add
            a leaky ReLu after the convolutional layer. Default: ``False``
        scale_factor: int, optional
            The amount to upscale the image. Default: `2`
        kwargs: dict
            Any additional Keras standard layer keyword arguments

        Returns
        -------
        tensor
            The output tensor from the Upscale layer
        """
        logger.debug("input_tensor: %s, filters: %s, kernel_size: %s, use_instance_norm: %s, "
                     "kwargs: %s)", input_tensor, filters, kernel_size, use_instance_norm, kwargs)
        name = self._get_name("upscale_{}".format(input_tensor.shape[1]))
        """ An upscale layer for sub-pixel up-scaling.

        Adds reflection padding if it has been selected by the user, and other post-processing
        if requested by the plugin.

        Parameters
        ----------
        input_tensor: tensor
            The input tensor to the layer
        filters: int
            The dimensionality of the output space (i.e. the number of output filters in the
            convolution)
        kernel_size: int, optional
            An integer or tuple/list of 2 integers, specifying the height and width of the 2D
            convolution window. Can be a single integer to specify the same value for all spatial
            dimensions. Default: 3
        padding: ["valid", "same"], optional
            The padding to use. Default: `"same"`
        use_instance_norm: bool, optional
            ``True`` if instance normalization should be applied after the convolutional layer.
            Default: ``False``
        res_block_follows: bool, optional
            If a residual block will follow this layer, then this should be set to `True` to add
            a leaky ReLu after the convolutional layer. Default: ``False``
        scale_factor: int, optional
            The amount to upscale the image. Default: `2`
        kwargs: dict
            Any additional Keras standard layer keyword arguments

        Returns
        -------
        tensor
            The output tensor from the Upscale layer
        """
        logger.debug("input_tensor: %s, filters: %s, kernel_size: %s, use_instance_norm: %s, "
                     "kwargs: %s)", input_tensor, filters, kernel_size, use_instance_norm, kwargs)
        name = self._get_name("upscale_{}".format(input_tensor.shape[1]))
        """ An upscale layer for sub-pixel up-scaling.

        Adds reflection padding if it has been selected by the user, and other post-processing
        if requested by the plugin.

        Parameters
        ----------
        input_tensor: tensor
            The input tensor to the layer
        filters: int
            The dimensionality of the output space (i.e. the number of output filters in the
            convolution)
        kernel_size: int, optional
            An integer or tuple/list of 2 integers, specifying the height and width of the 2D
            convolution window. Can be a single integer to specify the same value for all spatial
            dimensions. Default: 3
        padding: ["valid", "same"], optional
            The padding to use. Default: `"same"`
        use_instance_norm: bool, optional
            ``True`` if instance normalization should be applied after the convolutional layer.
            Default: ``False``
        res_block_follows: bool, optional
            If a residual block will follow this layer, then this should be set to `True` to add
            a leaky ReLu after the convolutional layer. Default: ``False``
        scale_factor: int, optional
            The amount to upscale the image. Default: `2`
        kwargs: dict
            Any additional Keras standard layer keyword arguments

        Returns
        -------
        tensor
            The output tensor from the Upscale layer
        """
        logger.debug("input_tensor: %s, filters: %s, kernel_size: %s, use_instance_norm: %s, "
                     "kwargs: %s)", input_tensor, filters, kernel_size, use_instance_norm, kwargs)
        name = self._get_name("upscale_{}".format(input_tensor.shape[1]))
        """ An upscale layer for sub-pixel up-scaling.

        Adds reflection padding if it has been selected by the user, and other post-processing
        if requested by the plugin.

        Parameters
        ----------
        input_tensor: tensor
            The input tensor to the layer
        filters: int
            The dimensionality of the output space (i.e. the number of output filters in the
            convolution)
        kernel_size: int, optional
            An integer or tuple/list of 2 integers, specifying the height and width of the 2D
            convolution window. Can be a single integer to specify the same value for all spatial
            dimensions. Default: 3
        padding: ["valid", "same"], optional
            The padding to use. Default: `"same"`
        use_instance_norm: bool, optional
            ``True`` if instance normalization should be applied after the convolutional layer.
            Default: ``False``
        res_block_follows: bool, optional
            If a residual block will follow this layer, then this should be set to `True` to add
            a leaky ReLu after the convolutional layer. Default: ``False``
        scale_factor: int, optional
            The amount to upscale the image. Default: `2`
        kwargs: dict
            Any additional Keras standard layer keyword arguments

        Returns
        -------
        tensor
            The output tensor from the Upscale layer
        """
        logger.debug("input_tensor: %s, filters: %s, kernel_size: %s, use_instance_norm: %s, "
                     "kwargs: %s)", input_tensor, filters, kernel_size, use_instance_norm, kwargs)
        name = self._get_name("upscale_{}".format(input_tensor.shape[1]))
          if self.use_reflect_padding:
              inp = ReflectionPadding2D(stride=1,
                                        kernel_size=kernel_size,
                                        name="{}_reflectionpadding2d".format(name))(inp)
              padding = "valid"
keep keep keep keep 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/nn_blocks.py