                              pool_mode="avg")
          logger.debug("resized tensor: %s", mask)
          return mask
  
      mask = scale_mask(mask, mask_scaling)
      if preprocessing_func is not None:
          mask = preprocessing_func(mask)
      mask_as_k_inv_prop = 1 - mask_prop
      mask = (mask * mask_prop) + mask_as_k_inv_prop
  
 
</s> remove     def inner_loss(y_true, y_pred):
        # Branching because tensorflows broadcasting is wonky and
        # plaidmls concatenate is implemented ineficient.
 </s> add     def _inner_loss(y_true, y_pred):
        """ Apply the loss function to the masked area of the image.

         Parameters
        ----------
        y_true: tensor or variable
            The ground truth value
        y_pred: tensor or variable
            The predicted value

        Returns
        -------
        tensor
            The Loss value

        Notes
        -----
        Branching because TensorFlow's broadcasting is wonky and plaidML's concatenate is
        implemented inefficiently.
        """ </s> remove 
    def scale_mask(mask, scaling):
        """ Scale the input mask to be the same size as the input face """
 </s> add     def _scale_mask(mask, scaling):
        """ Scale the input mask to be the same size as the input face

        Parameters
        ----------
        mask: input tensor
            The mask for the current image
        scaling: float
            The amount to scale the input mask by

        Returns
        -------
        tensor
            The resized input mask
        """ </s> remove     """ A wrapper for mask loss that can perform pre-processing on the input
        prior to calling the loss function
        loss_func: The loss function to use
        preprocessing_func: The preprocessing function to use. Should take a Keras Input
        as it's only argument """

 </s> add     """ A wrapper for mask loss that can perform pre-processing on the input prior to calling the
    loss function.

    Parameters
    ----------
    loss_func: class or function
        The actual loss function to use
    preprocessing_func: function
        The pre-processing function to use. Should take a Keras Input as it's only argument
    """ </s> remove     return inner_loss
 </s> add     return _inner_loss </s> remove     def make_kernel(sigma):
 </s> add     def _make_kernel(sigma):
        """ Make the gaussian kernel. """
    mask = _scale_mask(mask, mask_scaling)
                              pool_mode="avg")
          logger.debug("resized tensor: %s", mask)
          return mask
  
    mask = _scale_mask(mask, mask_scaling)
      if preprocessing_func is not None:
          mask = preprocessing_func(mask)
      mask_as_k_inv_prop = 1 - mask_prop
      mask = (mask * mask_prop) + mask_as_k_inv_prop
  
keep keep keep keep 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